42 Foam::timeVaryingMassSorptionFvPatchScalarField::ddtSchemeTypeNames_
45 ddtSchemeType::tsEuler,
46 fv::EulerDdtScheme<scalar>::typeName_()
49 ddtSchemeType::tsCrankNicolson,
50 fv::CrankNicolsonDdtScheme<scalar>::typeName_()
53 ddtSchemeType::tsBackward,
54 fv::backwardDdtScheme<scalar>::typeName_()
68 fixedValueFvPatchScalarField(
p, iF),
88 if (!this->readValueEntry(
dict))
98 const timeVaryingMassSorptionFvPatchScalarField& ptf,
100 const DimensionedField<scalar, volMesh>& iF,
101 const fvPatchFieldMapper& mapper
104 fixedValueFvPatchScalarField(ptf,
p, iF, mapper),
117 fixedValueFvPatchScalarField(ptf),
131 fixedValueFvPatchScalarField(ptf, iF),
145 fixedValueFvPatchScalarField::autoMap(m);
155 fixedValueFvPatchScalarField::rmap(ptf, addr);
163 auto& source = tsource.ref();
168 source = -kabs_*w*
max(patchInternalField() -
cp, scalar(0));
170 source += kdes_*
max(
cp - patchInternalField(), scalar(0));
183 const label patchi =
patch().index();
185 const scalar dt = db().time().deltaTValue();
192 const word ddtSchemeName(
fld.mesh().ddtScheme(
fld.name()));
193 const ddtSchemeType& ddtScheme = ddtSchemeTypeNames_[ddtSchemeName];
198 tmp<scalarField> dfldp =
201 *
max(patchInternalField() -
cp, scalar(0))
206 *
max(
cp - patchInternalField(), scalar(0))
212 case tsCrankNicolson:
214 operator==(fld0.boundaryField()[patchi] + dfldp);
220 const scalar dt0 = db().time().deltaT0Value();
222 const scalar
c = scalar(1) + dt/(dt + dt0);
223 const scalar c00 = dt*dt/(dt0*(dt + dt0));
224 const scalar c0 =
c + c00;
229 c0*fld0.boundaryField()[patchi]
230 - c00*fld0.oldTime().boundaryField()[patchi]
240 << ddtSchemeName <<
nl 241 <<
" on patch " << this->
patch().name()
242 <<
" of field " << this->internalField().name()
243 <<
" in file " << this->internalField().objectPath()
248 fixedValueFvPatchScalarField::updateCoeffs();
271 timeVaryingMassSorptionFvPatchScalarField
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
timeVaryingMassSorptionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy the source to the destination (recursively if necessary).
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual void write(Ostream &) const
Write.
virtual void write(Ostream &) const
Write.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fvPatchField< scalar > fvPatchScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
ddtSchemeType
Enumeration defining the available ddt schemes.
A FieldMapper for finite-volume patch fields.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
This boundary condition provides a first order fixed-value condition for a given scalar field to mode...
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
const dimensionedScalar c
Speed of light in a vacuum.
virtual void operator=(const UList< Type > &)
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
tmp< scalarField > source() const
Return source rate.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A class for managing temporary objects.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static constexpr const zero Zero
Global zero (0)