Public Member Functions | Private Member Functions | Private Attributes
scalarTransport Class Reference

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...

Collaboration diagram for scalarTransport:
Collaboration graph
[legend]

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 wordname () 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...
 
volScalarFieldtransportedField ()
 Return reference to registered transported field. More...
 
tmp< volScalarFieldDT (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 fvMeshmesh_
 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...
 

Detailed Description

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
See also
fvOption.H fvOptionList.H
Source files

Definition at line 167 of file scalarTransport.H.

Constructor & Destructor Documentation

◆ scalarTransport() [1/2]

scalarTransport ( const scalarTransport )
private

Disallow default bitwise copy construct.

◆ scalarTransport() [2/2]

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().

Here is the call graph for this function:

◆ ~scalarTransport()

~scalarTransport ( )
virtual

Destructor.

Definition at line 207 of file scalarTransport.C.

Member Function Documentation

◆ boundaryTypes()

Foam::wordList boundaryTypes ( ) const
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_.

Here is the call graph for this function:

◆ transportedField()

Foam::volScalarField & transportedField ( )
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.

Here is the call graph for this function:

◆ DT()

Foam::tmp< Foam::volScalarField > DT ( const surfaceScalarField phi) const
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.

◆ operator=()

void operator= ( const scalarTransport )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "scalarTransport"  )

Runtime type information.

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the set of scalarTransport.

Definition at line 255 of file scalarTransport.H.

References scalarTransport::name_.

◆ read()

void read ( const dictionary dict)
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().

Here is the call graph for this function:

◆ execute()

void execute ( )
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().

Here is the call graph for this function:

◆ end()

void end ( )
virtual

Execute at the final time-loop, currently does nothing.

Definition at line 329 of file scalarTransport.C.

◆ timeSet()

void timeSet ( )
virtual

Called when time was set at the end of the Time::operator++.

Definition at line 335 of file scalarTransport.C.

◆ write()

void write ( )
virtual

Calculate the scalarTransport and write.

Definition at line 341 of file scalarTransport.C.

◆ updateMesh()

virtual void updateMesh ( const mapPolyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 276 of file scalarTransport.H.

◆ movePoints()

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 280 of file scalarTransport.H.

Field Documentation

◆ name_

word name_
private

Name of this set of scalarTransport objects.

Definition at line 172 of file scalarTransport.H.

Referenced by scalarTransport::name().

◆ mesh_

const fvMesh& mesh_
private

Reference to the mesh database.

Definition at line 175 of file scalarTransport.H.

Referenced by scalarTransport::boundaryTypes().

◆ active_

bool active_
private

On/off switch.

Definition at line 178 of file scalarTransport.H.

◆ phiName_

word phiName_
private

Name of flux field (optional)

Definition at line 181 of file scalarTransport.H.

◆ UName_

word UName_
private

Name of velocity field (optional)

Definition at line 184 of file scalarTransport.H.

Referenced by scalarTransport::boundaryTypes().

◆ rhoName_

word rhoName_
private

Name of density field (optional)

Definition at line 187 of file scalarTransport.H.

◆ DT_

scalar DT_
private

Diffusion coefficient (optional)

Definition at line 190 of file scalarTransport.H.

◆ userDT_

bool userDT_
private

Flag to indicate whether user DT_ is used.

Definition at line 193 of file scalarTransport.H.

◆ resetOnStartUp_

bool resetOnStartUp_
private

Flag to reset scalar field on start-up.

Definition at line 196 of file scalarTransport.H.

◆ nCorr_

label nCorr_
private

Number of corrector iterations (optional)

Definition at line 199 of file scalarTransport.H.

◆ autoSchemes_

bool autoSchemes_
private

Flag to employ schemes for velocity for scalar transport.

Definition at line 202 of file scalarTransport.H.

◆ fvOptions_

fv::optionList fvOptions_
private

Run-time selectable finite volume options, e.g. sources, constraints.

Definition at line 205 of file scalarTransport.H.

◆ log_

Switch log_
private

Switch to send output to Info as well as to file.

Definition at line 208 of file scalarTransport.H.


The documentation for this class was generated from the following files: