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

This function object calculates and outputs the Courant number as a volScalarField. The field is stored on the mesh database so that it can be retrieved and used for other applications. More...

Collaboration diagram for CourantNo:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("CourantNo")
 Runtime type information. More...
 
 CourantNo (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~CourantNo ()
 Destructor. More...
 
virtual const wordname () const
 Return name of the set of CourantNo. More...
 
virtual void read (const dictionary &)
 Read the CourantNo 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 CourantNo 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

tmp< volScalarField::DimensionedInternalFieldbyRho (const tmp< volScalarField::DimensionedInternalField > &Co) const
 Divide Co by rho if required. More...
 
 CourantNo (const CourantNo &)
 Disallow default bitwise copy construct. More...
 
void operator= (const CourantNo &)
 Disallow default bitwise assignment. More...
 

Private Attributes

word name_
 Name of this set of CourantNo objects. More...
 
const objectRegistryobr_
 Reference to the database. More...
 
bool active_
 On/off switch. More...
 
word phiName_
 Name of flux field, default is "phi". More...
 
word rhoName_
 Name of density field (optional) More...
 
word resultName_
 Result name. More...
 
Switch log_
 Switch to send output to Info as well as to file. More...
 

Detailed Description

This function object calculates and outputs the Courant number as a volScalarField. The field is stored on the mesh database so that it can be retrieved and used for other applications.

Example of function object specification to calculate the Courant number:

CourantNo1
{
    type        CourantNo;
    functionObjectLibs ("libutilityFunctionObjects.so");
    ...
}


Function object usage

Property Description Required Default value
type Type name: CourantNo yes
rhoName Name of density field no rho
phiName Name of flux field no phi
resultName Name of Courant number field no <function name>
log Log to standard output no yes
Source files

Definition at line 111 of file CourantNo.H.

Constructor & Destructor Documentation

◆ CourantNo() [1/2]

CourantNo ( const CourantNo )
private

Disallow default bitwise copy construct.

◆ CourantNo() [2/2]

CourantNo ( 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 60 of file CourantNo.C.

References dict, Foam::dimless, Foam::endl(), mesh, Foam::nl, Foam::read(), and WarningInFunction.

Here is the call graph for this function:

◆ ~CourantNo()

~CourantNo ( )
virtual

Destructor.

Definition at line 115 of file CourantNo.C.

Member Function Documentation

◆ byRho()

Divide Co by rho if required.

Definition at line 42 of file CourantNo.C.

References Foam::dimDensity.

◆ operator=()

void operator= ( const CourantNo )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "CourantNo"  )

Runtime type information.

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the set of CourantNo.

Definition at line 178 of file CourantNo.H.

References CourantNo::name_.

Referenced by CourantNo::write().

Here is the caller graph for this function:

◆ read()

void read ( const dictionary dict)
virtual

Read the CourantNo data.

Definition at line 121 of file CourantNo.C.

References dict, and dictionary::readIfPresent().

Here is the call graph for this function:

◆ execute()

void execute ( )
virtual

Execute, currently does nothing.

Definition at line 134 of file CourantNo.C.

References TimeState::deltaT(), dimensionedInternalField(), GeometricField::dimensionedInternalField(), objectRegistry::lookupObject(), Foam::mag(), mesh, phi, Foam::fvc::surfaceSum(), fvMesh::time(), and fvMesh::V().

Here is the call graph for this function:

◆ end()

void end ( )
virtual

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

Definition at line 160 of file CourantNo.C.

◆ timeSet()

void timeSet ( )
virtual

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

Definition at line 166 of file CourantNo.C.

◆ write()

void write ( )
virtual

Calculate the CourantNo and write.

Definition at line 170 of file CourantNo.C.

References Foam::endl(), Foam::Info, CourantNo::name(), Foam::nl, Foam::type(), and CourantNo::write().

Referenced by CourantNo::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateMesh()

virtual void updateMesh ( const mapPolyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 199 of file CourantNo.H.

◆ movePoints()

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 203 of file CourantNo.H.

Field Documentation

◆ name_

word name_
private

Name of this set of CourantNo objects.

Definition at line 116 of file CourantNo.H.

Referenced by CourantNo::name().

◆ obr_

const objectRegistry& obr_
private

Reference to the database.

Definition at line 119 of file CourantNo.H.

◆ active_

bool active_
private

On/off switch.

Definition at line 122 of file CourantNo.H.

◆ phiName_

word phiName_
private

Name of flux field, default is "phi".

Definition at line 125 of file CourantNo.H.

◆ rhoName_

word rhoName_
private

Name of density field (optional)

Definition at line 128 of file CourantNo.H.

◆ resultName_

word resultName_
private

Result name.

Definition at line 131 of file CourantNo.H.

◆ log_

Switch log_
private

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

Definition at line 134 of file CourantNo.H.


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