ENH: more consistent handling/documentation of 'value' entry (#2703)
- for boundary conditions such as uniformFixed, uniformMixed etc the optional 'value' entry (optional) is used for the initial values and restarts. Otherwise the various Function1 or PatchFunction1 entries are evaluated and used determine the boundary condition values. In most cases this is OK, but in some case such coded or expression entries with references to other fields it can be problematic since they may reference fields (eg, phi) that have not yet been created. For these cases the 'value' entry will be needed: documentation updated accordingly. STYLE: eliminate some unneeded/unused declaration headers
This commit is contained in:
parent
fc86e52451
commit
97459771ad
@ -188,6 +188,9 @@ Foam::codedFixedValuePointPatchField<Type>::codedFixedValuePointPatchField
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
}
|
||||
|
@ -31,6 +31,9 @@ Description
|
||||
Constructs on-the-fly a new boundary condition (derived from
|
||||
fixedValuePointPatchField) which is then used to evaluate.
|
||||
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise the code is executed.
|
||||
|
||||
The code entries:
|
||||
\plaintable
|
||||
codeInclude | include files
|
||||
|
@ -25,21 +25,17 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "codedFixedValuePointPatchFields.H"
|
||||
#include "pointPatchFields.H"
|
||||
#include "codedFixedValuePointPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
#include "fieldTypes.H"
|
||||
#include "pointPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFields(codedFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
namespace Foam
|
||||
{
|
||||
makePointPatchFieldTypedefs(codedFixedValue);
|
||||
makePointPatchFields(codedFixedValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -1,51 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef codedFixedValuePointPatchFields_H
|
||||
#define codedFixedValuePointPatchFields_H
|
||||
|
||||
#include "codedFixedValuePointPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFieldTypedefs(codedFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -25,21 +25,16 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "timeVaryingUniformFixedValuePointPatchFields.H"
|
||||
#include "pointPatchFields.H"
|
||||
#include "timeVaryingUniformFixedValuePointPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
#include "pointPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFields(timeVaryingUniformFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
namespace Foam
|
||||
{
|
||||
makePointPatchFieldTypedefs(timeVaryingUniformFixedValue);
|
||||
makePointPatchFields(timeVaryingUniformFixedValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -1,59 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
InClass
|
||||
Foam::timeVaryingUniformFixedValuePointPatchFields
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
timeVaryingUniformFixedValuePointPatchFields.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef timeVaryingUniformFixedValuePointPatchFields_H
|
||||
#define timeVaryingUniformFixedValuePointPatchFields_H
|
||||
|
||||
#include "timeVaryingUniformFixedValuePointPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFieldTypedefs(timeVaryingUniformFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -56,7 +56,7 @@ Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField
|
||||
fixedValueFvPatchVectorField(p, iF, dict, IOobjectOption::NO_READ),
|
||||
tau0_(dict.getOrDefault<vector>("tau", Zero))
|
||||
{
|
||||
fvPatchField<vector>::patchInternalField(*this);
|
||||
this->extrapolateInternal(); // Zero-gradient patch values
|
||||
}
|
||||
|
||||
|
||||
|
@ -366,7 +366,7 @@ epsilonWallFunctionFvPatchScalarField
|
||||
cornerWeights_()
|
||||
{
|
||||
// Apply zero-gradient condition on start-up
|
||||
fvPatchField<scalar>::patchInternalField(*this);
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
|
||||
|
||||
|
@ -358,8 +358,8 @@ Foam::omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
|
||||
omega_(),
|
||||
cornerWeights_()
|
||||
{
|
||||
// apply zero-gradient condition on start-up
|
||||
fvPatchField<scalar>::patchInternalField(*this);
|
||||
// Apply zero-gradient condition on start-up
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
|
||||
|
||||
|
@ -70,7 +70,8 @@ freeSurfaceVelocityFvPatchVectorField
|
||||
fixedGradientFvPatchVectorField(p, iF)
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
fvPatchField<vector>::patchInternalField(*this);
|
||||
// Apply zero-gradient condition on start-up
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,7 +59,7 @@ solidBodyMotionDisplacementPointPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchVectorField(p, iF, dict, false),
|
||||
fixedValuePointPatchVectorField(p, iF, dict, IOobjectOption::NO_READ),
|
||||
SBMFPtr_(solidBodyMotionFunction::New(dict, this->db().time())),
|
||||
localPoints0Ptr_(nullptr)
|
||||
{
|
||||
|
@ -120,7 +120,7 @@ Foam::processorFaPatchField<Type>::processorFaPatchField
|
||||
// Use 'value' supplied, or set to internal field
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
faPatchField<Type>::patchInternalField(*this);
|
||||
this->extrapolateInternal(); // Zero-gradient patch values
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,7 @@ clampedPlateFaPatchField<Type>::clampedPlateFaPatchField
|
||||
:
|
||||
faPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||
{
|
||||
// Set to the internal field
|
||||
faPatchField<Type>::patchInternalField(*this);
|
||||
this->extrapolateInternal(); // Zero-gradient patch values
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,14 +74,13 @@ Foam::inletOutletFaPatchField<Type>::inletOutletFaPatchField
|
||||
{
|
||||
// Require inletValue (MUST_READ)
|
||||
this->refValue().assign("inletValue", dict, p.size());
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0;
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
faPatchField<Type>::operator=(this->refValue());
|
||||
faPatchField<Type>::extrapolateInternal();
|
||||
}
|
||||
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,6 +39,7 @@ Usage
|
||||
Property | Description | Required | Default value
|
||||
phi | Flux field name | no | phi
|
||||
inletValue | Inlet value for reverse flow | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -55,7 +56,6 @@ Usage
|
||||
The mode of operation is determined by the sign of the flux across the
|
||||
patch edges.
|
||||
|
||||
|
||||
Note
|
||||
Sign conventions:
|
||||
- Positive flux (out of domain): apply zero-gradient condition
|
||||
|
@ -41,7 +41,7 @@ Foam::outletInletFaPatchField<Type>::outletInletFaPatchField
|
||||
{
|
||||
this->refValue() = *this;
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
this->valueFraction() = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -72,15 +72,15 @@ Foam::outletInletFaPatchField<Type>::outletInletFaPatchField
|
||||
{
|
||||
faPatchFieldBase::readDict(dict);
|
||||
|
||||
// Require outletValue (MUST_READ)
|
||||
this->refValue().assign("outletValue", dict, p.size());
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0;
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
faPatchField<Type>::operator=(this->refValue());
|
||||
faPatchField<Type>::extrapolateInternal();
|
||||
}
|
||||
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,6 +38,7 @@ Usage
|
||||
Property | Description | Required | Default value
|
||||
phi | Flux field name | no | phi
|
||||
outletValue | Outlet value for reverse flow | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -92,7 +93,7 @@ protected:
|
||||
|
||||
// Protected Data
|
||||
|
||||
//- Name of flux field
|
||||
//- Name of flux field (default: phi)
|
||||
word phiName_;
|
||||
|
||||
|
||||
|
@ -58,6 +58,9 @@ timeVaryingUniformFixedValueFaPatchField
|
||||
{
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
|
||||
updateCoeffs();
|
||||
}
|
||||
|
||||
|
@ -26,21 +26,16 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "timeVaryingUniformFixedValueFaPatchFields.H"
|
||||
#include "timeVaryingUniformFixedValueFaPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "areaFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makeFaPatchFields(timeVaryingUniformFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
makeFaPatchTypeFieldTypedefs(timeVaryingUniformFixedValue);
|
||||
makeFaPatchFields(timeVaryingUniformFixedValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -1,51 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_timeVaryingUniformFixedValueFaPatchFields_H
|
||||
#define Foam_timeVaryingUniformFixedValueFaPatchFields_H
|
||||
|
||||
#include "timeVaryingUniformFixedValueFaPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeFaPatchTypeFieldTypedefs(timeVaryingUniformFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -73,7 +73,14 @@ Foam::uniformFixedGradientFaPatchField<Type>::uniformFixedGradientFaPatchField
|
||||
)
|
||||
)
|
||||
{
|
||||
this->evaluate();
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,6 +36,7 @@ Usage
|
||||
\table
|
||||
Property | Description | Required | Default
|
||||
uniformGradient | uniform gradient | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -51,6 +52,11 @@ Note
|
||||
The uniformGradient entry is a Function1 type.
|
||||
The example above gives the usage for supplying a constant value.
|
||||
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise the \c uniformGradient is used for the evaluation.
|
||||
In some cases (eg, coded or expression entries with references to other
|
||||
fields) this can be problematic and the \c value entry will be needed.
|
||||
|
||||
See also
|
||||
Foam::Function1Types
|
||||
Foam::fixedGradientFaPatchField
|
||||
|
@ -25,7 +25,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "uniformFixedGradientFaPatchFields.H"
|
||||
#include "uniformFixedGradientFaPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "areaFields.H"
|
||||
#include "edgeFields.H"
|
||||
@ -34,6 +34,7 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeFaPatchTypeFieldTypedefs(uniformFixedGradient);
|
||||
makeFaPatchFields(uniformFixedGradient);
|
||||
}
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_uniformFixedGradientFaPatchFields_H
|
||||
#define Foam_uniformFixedGradientFaPatchFields_H
|
||||
|
||||
#include "uniformFixedGradientFaPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeFaPatchTypeFieldTypedefs(uniformFixedGradient);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -75,6 +75,10 @@ Foam::uniformFixedValueFaPatchField<Type>::uniformFixedValueFaPatchField
|
||||
{
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate();
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ Usage
|
||||
\table
|
||||
Property | Description | Required | Default
|
||||
uniformValue | uniform value | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -52,6 +53,11 @@ Note
|
||||
able to describe time varying functions.
|
||||
The example above gives the usage for supplying a constant value.
|
||||
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise the \c uniformValue is evaluated.
|
||||
In some cases (eg, coded or expression entries with references to other
|
||||
fields) this can be problematic and the \c value entry will be needed.
|
||||
|
||||
See also
|
||||
Foam::Function1Types
|
||||
Foam::fixedValueFaPatchField
|
||||
|
@ -25,7 +25,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "uniformFixedValueFaPatchFields.H"
|
||||
#include "uniformFixedValueFaPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "areaFields.H"
|
||||
#include "edgeFields.H"
|
||||
@ -34,6 +34,7 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeFaPatchTypeFieldTypedefs(uniformFixedValue);
|
||||
makeFaPatchFields(uniformFixedValue);
|
||||
}
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_uniformFixedValueFaPatchFields_H
|
||||
#define Foam_uniformFixedValueFaPatchFields_H
|
||||
|
||||
#include "uniformFixedValueFaPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeFaPatchTypeFieldTypedefs(uniformFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -120,6 +120,10 @@ Foam::uniformMixedFaPatchField<Type>::uniformMixedFaPatchField
|
||||
// Use restart value if provided...
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate();
|
||||
}
|
||||
}
|
||||
@ -240,7 +244,7 @@ void Foam::uniformMixedFaPatchField<Type>::write(Ostream& os) const
|
||||
valueFractionFunc_->writeData(os);
|
||||
}
|
||||
|
||||
// Eg, for visualisation
|
||||
// For visualisation / restart
|
||||
faPatchField<Type>::writeValueEntry(os);
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,7 @@ Usage
|
||||
uniformValue | uniform value | partly | 0
|
||||
uniformGradient | uniform gradient | partly | 0
|
||||
uniformValueFraction | uniform valueFraction | partly | depends
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -67,6 +68,11 @@ Note
|
||||
If both \c uniformValue and \c uniformGradient are defined,
|
||||
the \c uniformValueFraction must also be defined.
|
||||
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise the function(s) are used for the evaluation.
|
||||
In some cases (eg, coded or expression entries with references to other
|
||||
fields) this can be problematic and the \c value entry will be needed.
|
||||
|
||||
See also
|
||||
Foam::Function1Types
|
||||
Foam::mixedFaPatchField
|
||||
|
@ -25,7 +25,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "uniformMixedFaPatchFields.H"
|
||||
#include "uniformMixedFaPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "areaFields.H"
|
||||
#include "edgeFields.H"
|
||||
@ -34,6 +34,7 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeFaPatchTypeFieldTypedefs(uniformMixed);
|
||||
makeFaPatchFields(uniformMixed);
|
||||
}
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_uniformMixedFaPatchFields_H
|
||||
#define Foam_uniformMixedFaPatchFields_H
|
||||
|
||||
#include "uniformMixedFaPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeFaPatchTypeFieldTypedefs(uniformMixed);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -128,15 +128,10 @@ Foam::exprFixedValueFvPatchField<Type>::exprFixedValueFvPatchField
|
||||
// Since we bypassed dictionary constructor
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
|
||||
const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
|
||||
|
||||
if (hasValue)
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
Field<Type>::assign(*hasValue, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
(*this) == this->patchInternalField();
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
|
||||
#ifdef FULLDEBUG
|
||||
WarningInFunction
|
||||
|
@ -32,11 +32,14 @@ Description
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default
|
||||
value | fixed value | yes |
|
||||
valueExpr | expression for uniformValue | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Note
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise uses a zero-gradient condition for the initial value.
|
||||
|
||||
This boundary condition is deprecated in favour of
|
||||
Foam::uniformFixedValueFvPatchField
|
||||
with expression entries.
|
||||
|
@ -169,7 +169,6 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
|
||||
// Since we bypassed dictionary constructor
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
|
||||
const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
|
||||
const auto* hasRefValue = dict.findEntry("refValue", keyType::LITERAL);
|
||||
|
||||
const auto* hasRefGradient
|
||||
@ -184,10 +183,8 @@ Foam::exprMixedFvPatchField<Type>::exprMixedFvPatchField
|
||||
this->refValue().assign(*hasRefValue, p.size());
|
||||
}
|
||||
|
||||
if (hasValue)
|
||||
if (this->readValueEntry(dict))
|
||||
{
|
||||
Field<Type>::assign(*hasValue, p.size());
|
||||
|
||||
if (!hasRefValue)
|
||||
{
|
||||
// Ensure refValue has a sensible value for the "update" below
|
||||
|
@ -35,9 +35,14 @@ Usage
|
||||
valueExpr | expression for uniformValue | partly | 0
|
||||
gradientExpr | expression for uniformGradient | partly | 0
|
||||
fractionExpr | expression for valueFraction | partly | depends
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Note
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise uses some heuristics of other entries
|
||||
(not properly documented now since this boundary condition is deprecated).
|
||||
|
||||
This boundary condition is deprecated in favour of
|
||||
Foam::uniformMixedFvPatchField,
|
||||
Foam::uniformFixedValueFvPatchField,
|
||||
|
@ -115,6 +115,11 @@ Foam::exprValuePointPatchField<Type>::exprValuePointPatchField
|
||||
dict_
|
||||
)
|
||||
{
|
||||
//FUTURE?
|
||||
//DeprecatedInFunction(2212)
|
||||
// << "Use uniformFixedValue with an expression Function1 instead." << nl
|
||||
// << " This boundary condition will be removed in the future" << endl;
|
||||
|
||||
// Require valueExpr
|
||||
if (this->valueExpr_.empty())
|
||||
{
|
||||
@ -125,18 +130,10 @@ Foam::exprValuePointPatchField<Type>::exprValuePointPatchField
|
||||
|
||||
driver_.readDict(dict_);
|
||||
|
||||
const auto* hasValue = dict.findEntry("value", keyType::LITERAL);
|
||||
|
||||
if (hasValue)
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
Field<Type>::assign(*hasValue, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Note: valuePointPatchField defaults to Zero
|
||||
// but internalField might be better
|
||||
|
||||
Field<Type>::operator=(Zero);
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
|
||||
if (this->evalOnConstruct_)
|
||||
|
@ -32,10 +32,13 @@ Description
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default
|
||||
value | fixed value | yes |
|
||||
valueExpr | expression for uniformValue | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise uses zero-gradient values.
|
||||
|
||||
SourceFiles
|
||||
exprValuePointPatchField.C
|
||||
|
||||
|
@ -25,21 +25,17 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "exprValuePointPatchFields.H"
|
||||
#include "pointPatchFields.H"
|
||||
#include "exprValuePointPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
#include "fieldTypes.H"
|
||||
#include "pointPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFields(exprValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
namespace Foam
|
||||
{
|
||||
makePointPatchFieldTypedefs(exprValue);
|
||||
makePointPatchFields(exprValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -1,51 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef exprValuePointPatchFields_H
|
||||
#define exprValuePointPatchFields_H
|
||||
|
||||
#include "exprValuePointPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFieldTypedefs(exprValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -77,7 +77,7 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
|
||||
}
|
||||
else
|
||||
{
|
||||
fvPatchField<Type>::patchInternalField(*this);
|
||||
this->extrapolateInternal(); // Zero-gradient patch values
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ Foam::processorFvPatchField<Type>::processorFvPatchField
|
||||
// Use 'value' supplied, or set to internal field
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fvPatchField<Type>::patchInternalField(*this);
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,12 +91,12 @@ Foam::advectiveFvPatchField<Type>::advectiveFvPatchField
|
||||
// Use 'value' supplied, or set to internal field
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fvPatchField<Type>::patchInternalField(*this);
|
||||
this->extrapolateInternal(); // Zero-gradient patch values
|
||||
}
|
||||
|
||||
this->refValue() = *this;
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
this->valueFraction() = 0;
|
||||
|
||||
if (dict.readIfPresent("lInf", lInf_))
|
||||
{
|
||||
|
@ -188,9 +188,10 @@ Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Assign dummy value to get redirectPatchField not fail
|
||||
fvPatchField<Type>::patchInternalField(*this);
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate(Pstream::commsTypes::blocking);
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,9 @@ Description
|
||||
Constructs on-the-fly a new boundary condition (derived from
|
||||
fixedValueFvPatchField) which is then used to evaluate.
|
||||
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise the code is executed.
|
||||
|
||||
The code entries:
|
||||
\plaintable
|
||||
codeInclude | include files
|
||||
|
@ -25,21 +25,17 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "codedFixedValueFvPatchFields.H"
|
||||
#include "codedFixedValueFvPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fieldTypes.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePatchFields(codedFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeFieldTypedefs(codedFixedValue);
|
||||
makePatchFields(codedFixedValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -1,51 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef codedFixedValueFvPatchFields_H
|
||||
#define codedFixedValueFvPatchFields_H
|
||||
|
||||
#include "codedFixedValueFvPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeFieldTypedefs(codedFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -107,8 +107,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef codedMixedFvPatchField_H
|
||||
#define codedMixedFvPatchField_H
|
||||
#ifndef Foam_codedMixedFvPatchField_H
|
||||
#define Foam_codedMixedFvPatchField_H
|
||||
|
||||
#include "mixedFvPatchFields.H"
|
||||
#include "codedBase.H"
|
||||
|
@ -25,21 +25,17 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "codedMixedFvPatchFields.H"
|
||||
#include "codedMixedFvPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fieldTypes.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePatchFields(codedMixed);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeFieldTypedefs(codedMixed);
|
||||
makePatchFields(codedMixed);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -1,51 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef codedMixedFvPatchFields_H
|
||||
#define codedMixedFvPatchFields_H
|
||||
|
||||
#include "codedMixedFvPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeFieldTypedefs(codedMixed);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -208,7 +208,7 @@ electrostaticDepositionFvPatchScalarField
|
||||
{
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fvPatchField<scalar>::patchInternalField(*this);
|
||||
this->extrapolateInternal(); // Zero-gradient patch values
|
||||
}
|
||||
|
||||
// If flow is multiphase
|
||||
|
@ -70,13 +70,10 @@ fluxCorrectedVelocityFvPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
zeroGradientFvPatchVectorField(p, iF),
|
||||
zeroGradientFvPatchVectorField(p, iF, dict),
|
||||
phiName_(dict.getOrDefault<word>("phi", "phi")),
|
||||
rhoName_(dict.getOrDefault<word>("rho", "rho"))
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
fvPatchField<vector>::patchInternalField(*this);
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
Foam::fluxCorrectedVelocityFvPatchVectorField::
|
||||
|
@ -73,15 +73,15 @@ Foam::inletOutletFvPatchField<Type>::inletOutletFvPatchField
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
|
||||
// Require inletValue (MUST_READ)
|
||||
this->refValue().assign("inletValue", dict, p.size());
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0;
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fvPatchField<Type>::operator=(this->refValue());
|
||||
fvPatchField<Type>::extrapolateInternal();
|
||||
}
|
||||
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,6 +38,7 @@ Usage
|
||||
Property | Description | Required | Default value
|
||||
phi | Flux field name | no | phi
|
||||
inletValue | Inlet value for reverse flow | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -88,10 +89,9 @@ class inletOutletFvPatchField
|
||||
:
|
||||
public mixedFvPatchField<Type>
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
// Protected Data
|
||||
|
||||
//- Name of flux field
|
||||
word phiName_;
|
||||
|
@ -42,7 +42,7 @@ Foam::outletInletFvPatchField<Type>::outletInletFvPatchField
|
||||
{
|
||||
this->refValue() = *this;
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
this->valueFraction() = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -73,15 +73,15 @@ Foam::outletInletFvPatchField<Type>::outletInletFvPatchField
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
|
||||
// Require outletValue (MUST_READ)
|
||||
this->refValue().assign("outletValue", dict, p.size());
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0;
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fvPatchField<Type>::operator=(this->refValue());
|
||||
fvPatchField<Type>::extrapolateInternal();
|
||||
}
|
||||
|
||||
this->refGrad() = Zero;
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,6 +38,7 @@ Usage
|
||||
Property | Description | Required | Default value
|
||||
phi | Flux field name | no | phi
|
||||
outletValue | Outlet value for reverse flow | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -88,12 +89,11 @@ class outletInletFvPatchField
|
||||
:
|
||||
public mixedFvPatchField<Type>
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
// Protected Data
|
||||
|
||||
//- Name of flux field
|
||||
//- Name of flux field (default: phi)
|
||||
word phiName_;
|
||||
|
||||
|
||||
|
@ -171,7 +171,7 @@ outletMappedUniformInletFvPatchField
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Fallback: set to the internal field
|
||||
fvPatchField<Type>::patchInternalField(*this);
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ outletMappedUniformInletFvPatchField
|
||||
else
|
||||
{
|
||||
// Fallback: set to the internal field
|
||||
fvPatchField<Type>::patchInternalField(*this);
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,11 +82,11 @@ Foam::outletPhaseMeanVelocityFvPatchVectorField
|
||||
|
||||
refValue() = Zero;
|
||||
refGrad() = Zero;
|
||||
valueFraction() = 0.0;
|
||||
valueFraction() = 0;
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fvPatchField<vector>::patchInternalField(*this);
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ supersonicFreestreamFvPatchVectorField
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fvPatchField<vector>::patchInternalField(*this);
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
|
||||
refValue() = *this;
|
||||
|
@ -25,21 +25,16 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "timeVaryingMappedFixedValueFvPatchFields.H"
|
||||
#include "timeVaryingMappedFixedValueFvPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePatchFields(timeVaryingMappedFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
makePatchTypeFieldTypedefs(timeVaryingMappedFixedValue);
|
||||
makePatchFields(timeVaryingMappedFixedValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -1,51 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef timeVaryingMappedFixedValueFvPatchFields_H
|
||||
#define timeVaryingMappedFixedValueFvPatchFields_H
|
||||
|
||||
#include "timeVaryingMappedFixedValueFvPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeFieldTypedefs(timeVaryingMappedFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -62,7 +62,7 @@ Foam::turbulentInletFvPatchField<Type>::turbulentInletFvPatchField
|
||||
{
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fixedValueFvPatchField<Type>::operator==(referenceField_);
|
||||
fvPatchField<Type>::operator=(referenceField_);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,15 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
)
|
||||
{
|
||||
fvPatchFieldBase::readDict(dict);
|
||||
this->evaluate();
|
||||
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Ensure field has initialised values
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,6 +37,7 @@ Usage
|
||||
\table
|
||||
Property | Description | Required | Default
|
||||
uniformGradient | uniform gradient | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -53,6 +54,11 @@ Note
|
||||
able to describe time and spatial varying functions.
|
||||
The example above gives the usage for supplying a constant value.
|
||||
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise the \c uniformGradient is used for the evaluation.
|
||||
In some cases (eg, coded or expression entries with references to other
|
||||
fields) this can be problematic and the \c value entry will be needed.
|
||||
|
||||
See also
|
||||
Foam::Function1Types
|
||||
Foam::fixedGradientFvPatchField
|
||||
|
@ -25,21 +25,17 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "uniformFixedGradientFvPatchFields.H"
|
||||
#include "uniformFixedGradientFvPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fieldTypes.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePatchFields(uniformFixedGradient);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeFieldTypedefs(uniformFixedGradient);
|
||||
makePatchFields(uniformFixedGradient);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -1,51 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef uniformFixedGradientFvPatchFields_H
|
||||
#define uniformFixedGradientFvPatchFields_H
|
||||
|
||||
#include "uniformFixedGradientFvPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeFieldTypedefs(uniformFixedGradient);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -68,6 +68,10 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||
{
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate();
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ Usage
|
||||
\table
|
||||
Property | Description | Required | Default
|
||||
uniformValue | uniform value | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -53,6 +54,11 @@ Note
|
||||
able to describe time and spatial varying functions.
|
||||
The example above gives the usage for supplying a constant value.
|
||||
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise the \c uniformValue is evaluated.
|
||||
In some cases (eg, coded or expression entries with references to other
|
||||
fields) this can be problematic and the \c value entry will be needed.
|
||||
|
||||
See also
|
||||
Foam::Function1Types
|
||||
Foam::fixedValueFvPatchField
|
||||
|
@ -25,7 +25,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "uniformFixedValueFvPatchFields.H"
|
||||
#include "uniformFixedValueFvPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "volFields.H"
|
||||
|
||||
@ -33,6 +33,7 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeFieldTypedefs(uniformFixedValue);
|
||||
makePatchFields(uniformFixedValue);
|
||||
}
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_uniformFixedValueFvPatchFields_H
|
||||
#define Foam_uniformFixedValueFvPatchFields_H
|
||||
|
||||
#include "uniformFixedValueFvPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeFieldTypedefs(uniformFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -110,6 +110,10 @@ Foam::uniformMixedFvPatchField<Type>::uniformMixedFvPatchField
|
||||
// Use restart value if provided...
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate();
|
||||
}
|
||||
}
|
||||
@ -230,7 +234,7 @@ void Foam::uniformMixedFvPatchField<Type>::write(Ostream& os) const
|
||||
valueFractionFunc_->writeData(os);
|
||||
}
|
||||
|
||||
// Eg, for visualisation
|
||||
// For visualisation / restart
|
||||
fvPatchField<Type>::writeValueEntry(os);
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ Usage
|
||||
uniformValue | uniform value | partly | 0
|
||||
uniformGradient | uniform gradient | partly | 0
|
||||
uniformValueFraction | uniform valueFraction | partly | depends
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -70,6 +71,11 @@ Note
|
||||
If both \c uniformValue and \c uniformGradient are defined,
|
||||
the \c uniformValueFraction must also be defined.
|
||||
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise the function(s) are used for the evaluation.
|
||||
In some cases (eg, coded or expression entries with references to other
|
||||
fields) this can be problematic and the \c value entry will be needed.
|
||||
|
||||
See also
|
||||
Foam::Function1Types
|
||||
Foam::mixedFvPatchField
|
||||
|
@ -25,7 +25,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "uniformMixedFvPatchFields.H"
|
||||
#include "uniformMixedFvPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "volFields.H"
|
||||
|
||||
@ -33,6 +33,7 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeFieldTypedefs(uniformMixed);
|
||||
makePatchFields(uniformMixed);
|
||||
}
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_uniformMixedFvPatchFields_H
|
||||
#define Foam_uniformMixedFvPatchFields_H
|
||||
|
||||
#include "uniformMixedFvPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeFieldTypedefs(uniformMixed);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -86,7 +86,7 @@ Foam::variableHeightFlowRateFvPatchScalarField
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Fallback: set to the internal field
|
||||
fvPatchField<scalar>::patchInternalField(*this);
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
|
||||
this->refValue() = 0.0;
|
||||
|
@ -176,7 +176,7 @@ Foam::fvPatchField<Type>::fvPatchField
|
||||
// For unmapped faces set to internal field value (zero-gradient)
|
||||
if (notNull(iF) && mapper.hasUnmapped())
|
||||
{
|
||||
fvPatchField<Type>::patchInternalField(*this);
|
||||
this->extrapolateInternal();
|
||||
}
|
||||
this->map(ptf, mapper);
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ externalCoupledTemperatureMixedFvPatchScalarField
|
||||
// or extrapolated value
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fvPatchField<scalar>::patchInternalField(*this);
|
||||
fvPatchField<scalar>::extrapolateInternal();
|
||||
}
|
||||
|
||||
// Initialise as a fixed value
|
||||
@ -254,7 +254,7 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::writeData
|
||||
const scalarField& Twall = *this;
|
||||
|
||||
// Fluid temperature [K]
|
||||
tmp<scalarField> tfluid;
|
||||
scalarField Tfluid(size());
|
||||
|
||||
if (refTempType_ == refTemperatureType::USER)
|
||||
{
|
||||
@ -262,16 +262,14 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::writeData
|
||||
const scalar currTref =
|
||||
Tref_->value(this->db().time().timeOutputValue());
|
||||
|
||||
tfluid = tmp<scalarField>::New(size(), currTref);
|
||||
Tfluid = currTref;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Near wall cell temperature
|
||||
tfluid = patchInternalField();
|
||||
this->patchInternalField(Tfluid);
|
||||
}
|
||||
|
||||
const scalarField Tfluid(tfluid);
|
||||
|
||||
// Heat transfer coefficient [W/m2/K]
|
||||
// This htc needs to be always larger or equal to zero
|
||||
//const scalarField htc(qDot/max(Twall - Tfluid, 1e-3));
|
||||
|
@ -64,7 +64,7 @@ timeVaryingMappedFixedValuePointPatchField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(p, iF, dict, false),
|
||||
fixedValuePointPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ),
|
||||
setAverage_(dict.getOrDefault("setAverage", false)),
|
||||
perturb_(dict.getOrDefault("perturb", 1e-5)),
|
||||
fieldTableName_(iF.name()),
|
||||
|
@ -25,21 +25,16 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "timeVaryingMappedFixedValuePointPatchFields.H"
|
||||
#include "pointPatchFields.H"
|
||||
#include "timeVaryingMappedFixedValuePointPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
#include "pointPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFields(timeVaryingMappedFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
namespace Foam
|
||||
{
|
||||
makePointPatchFieldTypedefs(timeVaryingMappedFixedValue);
|
||||
makePointPatchFields(timeVaryingMappedFixedValue);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -1,59 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
InClass
|
||||
Foam::timeVaryingMappedFixedValuePointPatchFields
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
timeVaryingMappedFixedValuePointPatchFields.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef timeVaryingMappedFixedValuePointPatchFields_H
|
||||
#define timeVaryingMappedFixedValuePointPatchFields_H
|
||||
|
||||
#include "timeVaryingMappedFixedValuePointPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFieldTypedefs(timeVaryingMappedFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -32,6 +32,9 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
// Alternative
|
||||
// refCast<const facePointPatch>(p).patch()
|
||||
|
||||
template<class Type>
|
||||
const Foam::polyPatch&
|
||||
Foam::uniformFixedValuePointPatchField<Type>::getPatch(const pointPatch& p)
|
||||
@ -87,6 +90,10 @@ uniformFixedValuePointPatchField
|
||||
{
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
// Ensure field has reasonable initial values
|
||||
this->extrapolateInternal();
|
||||
|
||||
// Evaluate to assign a value
|
||||
this->evaluate();
|
||||
}
|
||||
}
|
||||
@ -194,7 +201,7 @@ void Foam::uniformFixedValuePointPatchField<Type>::updateCoeffs()
|
||||
}
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
|
||||
fixedValuePointPatchField<Type>::operator==(refValueFunc_->value(t));
|
||||
valuePointPatchField<Type>::operator=(refValueFunc_->value(t));
|
||||
fixedValuePointPatchField<Type>::updateCoeffs();
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,14 @@ Class
|
||||
Foam::uniformFixedValuePointPatchField
|
||||
|
||||
Description
|
||||
Enables the specification of a uniform fixed value boundary condition.
|
||||
Enables the specification of a uniform fixed value condition.
|
||||
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default
|
||||
uniformValue | uniform value | yes |
|
||||
value | initial field value | optional |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
@ -39,10 +46,16 @@ Description
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Note
|
||||
The uniformValue entry is a PatchFunction1 type,
|
||||
able to describe time and spatial varying functions.
|
||||
The example above gives the usage for supplying a constant value.
|
||||
|
||||
The \c value entry (optional) is used for the initial values.
|
||||
Otherwise the \c uniformValue is evaluated.
|
||||
In some cases (eg, coded or expression entries with references to other
|
||||
fields) this can be problematic and the \c value entry will be needed.
|
||||
|
||||
SourceFiles
|
||||
uniformFixedValuePointPatchField.C
|
||||
|
||||
|
@ -25,14 +25,15 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "uniformFixedValuePointPatchFields.H"
|
||||
#include "pointPatchFields.H"
|
||||
#include "uniformFixedValuePointPatchField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "pointPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePointPatchFieldTypedefs(uniformFixedValue);
|
||||
makePointPatchFields(uniformFixedValue);
|
||||
}
|
||||
|
||||
|
@ -1,58 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
InClass
|
||||
Foam::uniformFixedValuePointPatchFields
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
uniformFixedValuePointPatchFields.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_uniformFixedValuePointPatchFields_H
|
||||
#define Foam_uniformFixedValuePointPatchFields_H
|
||||
|
||||
#include "uniformFixedValuePointPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFieldTypedefs(uniformFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -113,7 +113,7 @@ Foam::oversetFvPatchField<Type>::oversetFvPatchField
|
||||
// Use 'value' supplied, or set to internal field
|
||||
if (!this->readValueEntry(dict))
|
||||
{
|
||||
fvPatchField<Type>::patchInternalField(*this);
|
||||
fvPatchField<Type>::extrapolateInternal();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ timeVaryingMassSorptionFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF, dict, false),
|
||||
fixedValueFvPatchScalarField(p, iF, dict, IOobjectOption::NO_READ),
|
||||
kabs_(dict.getCheck<scalar>("kabs", scalarMinMax::ge(0))),
|
||||
max_(dict.getCheck<scalar>("max", scalarMinMax::ge(0))),
|
||||
kdes_(dict.getCheckOrDefault<scalar>("kdes", 0, scalarMinMax::ge(0)))
|
||||
|
@ -69,7 +69,7 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF, dict, false),
|
||||
fixedValueFvPatchScalarField(p, iF, dict, IOobjectOption::NO_READ),
|
||||
qro_("qro", dict, p.size())
|
||||
{
|
||||
if (!this->readValueEntry(dict))
|
||||
|
@ -69,7 +69,8 @@ alphaFixedPressureFvPatchScalarField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF, dict, false),
|
||||
// The 'value' is optional (handled below)
|
||||
fixedValueFvPatchScalarField(p, iF, dict, IOobjectOption::NO_READ),
|
||||
p_("p", dict, p.size())
|
||||
{
|
||||
if (!this->readValueEntry(dict))
|
||||
|
@ -166,7 +166,7 @@ Foam::waveMakerPointPatchVectorField::waveMakerPointPatchVectorField
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<vector>(p, iF, dict, false),
|
||||
fixedValuePointPatchField<vector>(p, iF, dict, IOobjectOption::NO_READ),
|
||||
motionType_(motionTypeNames.get("motionType", dict)),
|
||||
n_(dict.get<vector>("n")),
|
||||
gHat_(Zero),
|
||||
|
Loading…
Reference in New Issue
Block a user