TimeFunction< DimensionedFieldType > Class Template Reference

Time dependent internal and patch field initialisation and update function. More...

Inheritance diagram for TimeFunction< DimensionedFieldType >:
Collaboration diagram for TimeFunction< DimensionedFieldType >:

Public Member Functions

 TypeName ("timeFunction")
 Runtime type information. More...
 
 TimeFunction (const dictionary &dict, DimensionedFieldType &field)
 Construct with dictionary to initialise given field. More...
 
 TimeFunction (const TimeFunction &dff, DimensionedFieldType &field)
 Construct a copy for the given field. More...
 
virtual autoPtr< DimensionedFieldFunction< DimensionedFieldType > > clone (DimensionedFieldType &field) const
 Construct and return a clone for the specified field. More...
 
virtual ~TimeFunction ()
 Destructor. More...
 
virtual void evaluate ()
 Evaluate the function and set the field. More...
 
virtual bool update ()
 Update the field for the current time. More...
 
virtual void write (Ostream &os) const
 Write data to dictionary stream. More...
 
- Public Member Functions inherited from DimensionedFieldFunction< DimensionedFieldType >
 TypeName ("DimensionedFieldFunction")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, DimensionedFieldFunction, dictionary,(const dictionary &dict, DimensionedFieldType &field),(dict, field))
 
 DimensionedFieldFunction (const dictionary &dict, DimensionedFieldType &field)
 Construct with dictionary to initialise given field. More...
 
 DimensionedFieldFunction (const DimensionedFieldFunction &dff, DimensionedFieldType &field)
 Construct a copy for the given field. More...
 
 DimensionedFieldFunction (const DimensionedFieldFunction< DimensionedFieldType > &)=delete
 Disallow default bitwise copy construction. More...
 
virtual autoPtr< DimensionedFieldFunction< DimensionedFieldType > > clone () const
 Construct and return a clone for the specified field. More...
 
virtual ~DimensionedFieldFunction ()
 Destructor. More...
 
virtual void reset ()
 Reset the field size. More...
 
void operator= (const DimensionedFieldFunction< DimensionedFieldType > &)=delete
 Disallow default bitwise assignment. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DimensionedFieldFunction< DimensionedFieldType >
static autoPtr< DimensionedFieldFunction< DimensionedFieldType > > New (const dictionary &dict, DimensionedFieldType &field)
 Select null constructed. More...
 
- Protected Attributes inherited from DimensionedFieldFunction< DimensionedFieldType >
DimensionedFieldType & field_
 Reference to the field the function applies to. More...
 

Detailed Description

template<class DimensionedFieldType>
class Foam::DimensionedFieldFunctions::TimeFunction< DimensionedFieldType >

Time dependent internal and patch field initialisation and update function.

The field is initialised by evaluating the specified Foam::Function1 for the current time.

Usage
To coded pulsed inlet using the functionalFixedValue boundary condition:
inlet
{
    type            functionalFixedValue;

    value
    {
        type        timeFunction;

        function
        {
            type        coded;

            name        pulse;

            codeInclude
            #{
                #include "mathematicalConstants.H"
            #};

            code
            #{
                return vector
                (
                    0.5
                   *(1 - cos(constant::mathematical::twoPi*min(x/0.3, 1))),
                    0,
                    0
                );
            #};
        }
    }
}
Source files

Definition at line 92 of file TimeFunction_DimensionedFieldFunction.H.

Constructor & Destructor Documentation

◆ TimeFunction() [1/2]

TimeFunction ( const dictionary dict,
DimensionedFieldType &  field 
)

Construct with dictionary to initialise given field.

Definition at line 32 of file TimeFunction_DimensionedFieldFunction.C.

◆ TimeFunction() [2/2]

TimeFunction ( const TimeFunction< DimensionedFieldType > &  dff,
DimensionedFieldType &  field 
)

Construct a copy for the given field.

Definition at line 54 of file TimeFunction_DimensionedFieldFunction.C.

◆ ~TimeFunction()

virtual ~TimeFunction ( )
inlinevirtual

Destructor.

Definition at line 130 of file TimeFunction_DimensionedFieldFunction.H.

Member Function Documentation

◆ TypeName()

TypeName ( "timeFunction"  )

Runtime type information.

◆ clone()

Foam::autoPtr< Foam::DimensionedFieldFunction< DimensionedFieldType > > clone ( DimensionedFieldType &  field) const
virtual

Construct and return a clone for the specified field.

Implements DimensionedFieldFunction< DimensionedFieldType >.

Definition at line 68 of file TimeFunction_DimensionedFieldFunction.C.

◆ evaluate()

void evaluate
virtual

Evaluate the function and set the field.

Implements DimensionedFieldFunction< DimensionedFieldType >.

Definition at line 83 of file TimeFunction_DimensionedFieldFunction.C.

◆ update()

bool update
virtual

Update the field for the current time.

Reimplemented from DimensionedFieldFunction< DimensionedFieldType >.

Definition at line 92 of file TimeFunction_DimensionedFieldFunction.C.

References Foam::evaluate().

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write data to dictionary stream.

Implements DimensionedFieldFunction< DimensionedFieldType >.

Definition at line 101 of file TimeFunction_DimensionedFieldFunction.C.

References Foam::dimLength, and Foam::writeEntry().

Here is the call graph for this function:

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