This function object evolves a passive scalar transport equation. The field is initially zero, to which sources are added. The field name is assigned the name of the function object. Boundary conditions are read from file if the field file is available, or automatically applied based on the velocity boundary conditions. More...
Public Member Functions | |
TypeName ("scalarTransport") | |
Runtime type information. More... | |
scalarTransport (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false) | |
Construct for given objectRegistry and dictionary. More... | |
virtual | ~scalarTransport () |
Destructor. More... | |
virtual const word & | name () const |
Return name of the set of scalarTransport. More... | |
virtual void | read (const dictionary &) |
Read the scalarTransport data. More... | |
virtual void | execute () |
Execute, currently does nothing. More... | |
virtual void | end () |
Execute at the final time-loop, currently does nothing. More... | |
virtual void | timeSet () |
Called when time was set at the end of the Time::operator++. More... | |
virtual void | write () |
Calculate the scalarTransport and write. More... | |
virtual void | updateMesh (const mapPolyMesh &) |
Update for changes of mesh. More... | |
virtual void | movePoints (const polyMesh &) |
Update for changes of mesh. More... | |
Private Member Functions | |
wordList | boundaryTypes () const |
Return the boundary types for the scalar field. More... | |
volScalarField & | transportedField () |
Return reference to registered transported field. More... | |
tmp< volScalarField > | DT (const surfaceScalarField &phi) const |
Return the diffusivity field. More... | |
scalarTransport (const scalarTransport &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const scalarTransport &) |
Disallow default bitwise assignment. More... | |
Private Attributes | |
word | name_ |
Name of this set of scalarTransport objects. More... | |
const fvMesh & | mesh_ |
Reference to the mesh database. More... | |
bool | active_ |
On/off switch. More... | |
word | phiName_ |
Name of flux field (optional) More... | |
word | UName_ |
Name of velocity field (optional) More... | |
word | rhoName_ |
Name of density field (optional) More... | |
scalar | DT_ |
Diffusion coefficient (optional) More... | |
bool | userDT_ |
Flag to indicate whether user DT_ is used. More... | |
bool | resetOnStartUp_ |
Flag to reset scalar field on start-up. More... | |
label | nCorr_ |
Number of corrector iterations (optional) More... | |
bool | autoSchemes_ |
Flag to employ schemes for velocity for scalar transport. More... | |
fv::optionList | fvOptions_ |
Run-time selectable finite volume options, e.g. sources, constraints. More... | |
Switch | log_ |
Switch to send output to Info as well as to file. More... | |
This function object evolves a passive scalar transport equation. The field is initially zero, to which sources are added. The field name is assigned the name of the function object. Boundary conditions are read from file if the field file is available, or automatically applied based on the velocity boundary conditions.
- the field can be zeroed on start-up using the resetOnStartUp flag
Example of function object specification to solve a scalar transport equation:
functions { scalar1 // <--- NOTE: SCALAR NAME { type scalarTransport; functionObjectLibs ("libutilityFunctionObjects.so"); resetOnStartUp no; autoSchemes yes; fvOptions { ... } } }
Function object usage
Property | Description | Required | Default value |
---|---|---|---|
type | Type name: scalarTransport | yes | |
phiName | Name of flux field | no | phi |
UName | Name of velocity field | no | U |
rhoName | Name of density field | no | rho |
nCorr | Number of correctors | no | 0 |
DT | Diffision coefficient | no | auto generated |
resetOnStartUp | Reset source to zero on start-up | no | no |
autoSchemes | Use U schemes to evolve scalar | no | yes |
fvOptions | List of scalar sources | yes | |
log | Log to standard output | no | yes |
Definition at line 167 of file scalarTransport.H.
|
private |
Disallow default bitwise copy construct.
scalarTransport | ( | const word & | name, |
const objectRegistry & | obr, | ||
const dictionary & | dict, | ||
const bool | loadFromFiles = false |
||
) |
Construct for given objectRegistry and dictionary.
Allow the possibility to load fields from files
Definition at line 171 of file scalarTransport.C.
References dict, Foam::dimless, Foam::read(), and Foam::T().
|
virtual |
Destructor.
Definition at line 207 of file scalarTransport.C.
|
private |
Return the boundary types for the scalar field.
Definition at line 50 of file scalarTransport.C.
References forAll, objectRegistry::lookupObject(), scalarTransport::mesh_, U, and scalarTransport::UName_.
|
private |
Return reference to registered transported field.
Definition at line 73 of file scalarTransport.C.
References IOobject::AUTO_WRITE, Foam::dimless, Foam::name(), and IOobject::READ_IF_PRESENT.
|
private |
Return the diffusivity field.
Definition at line 102 of file scalarTransport.C.
References Foam::dimLength, IOobject::NO_READ, IOobject::NO_WRITE, phi, and turbulenceModel::propertiesName.
|
private |
Disallow default bitwise assignment.
TypeName | ( | "scalarTransport" | ) |
Runtime type information.
|
inlinevirtual |
Return name of the set of scalarTransport.
Definition at line 255 of file scalarTransport.H.
References scalarTransport::name_.
|
virtual |
Read the scalarTransport data.
Definition at line 213 of file scalarTransport.C.
References dict, Foam::Info, dictionary::lookup(), Foam::nl, dictionary::readIfPresent(), dictionary::subDict(), and Foam::type().
|
virtual |
Execute, currently does nothing.
Definition at line 240 of file scalarTransport.C.
References Foam::fvm::ddt(), Foam::dimMass, Foam::dimTime, Foam::dimVolume, Foam::fvm::div(), Foam::endl(), FatalErrorInFunction, Foam::Info, Foam::fvm::laplacian(), Foam::nl, phi, fvMatrix::relax(), rho, fvMatrix::solve(), Foam::T(), TEqn(), and Foam::type().
|
virtual |
Execute at the final time-loop, currently does nothing.
Definition at line 329 of file scalarTransport.C.
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 335 of file scalarTransport.C.
|
virtual |
Calculate the scalarTransport and write.
Definition at line 341 of file scalarTransport.C.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 276 of file scalarTransport.H.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 280 of file scalarTransport.H.
|
private |
Name of this set of scalarTransport objects.
Definition at line 172 of file scalarTransport.H.
Referenced by scalarTransport::name().
|
private |
Reference to the mesh database.
Definition at line 175 of file scalarTransport.H.
Referenced by scalarTransport::boundaryTypes().
|
private |
On/off switch.
Definition at line 178 of file scalarTransport.H.
|
private |
Name of flux field (optional)
Definition at line 181 of file scalarTransport.H.
|
private |
Name of velocity field (optional)
Definition at line 184 of file scalarTransport.H.
Referenced by scalarTransport::boundaryTypes().
|
private |
Name of density field (optional)
Definition at line 187 of file scalarTransport.H.
|
private |
Diffusion coefficient (optional)
Definition at line 190 of file scalarTransport.H.
|
private |
Flag to indicate whether user DT_ is used.
Definition at line 193 of file scalarTransport.H.
|
private |
Flag to reset scalar field on start-up.
Definition at line 196 of file scalarTransport.H.
|
private |
Number of corrector iterations (optional)
Definition at line 199 of file scalarTransport.H.
|
private |
Flag to employ schemes for velocity for scalar transport.
Definition at line 202 of file scalarTransport.H.
|
private |
Run-time selectable finite volume options, e.g. sources, constraints.
Definition at line 205 of file scalarTransport.H.
|
private |
Switch to send output to Info as well as to file.
Definition at line 208 of file scalarTransport.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.