FreeFOAM The Cross-Platform CFD Toolkit
TimeActivatedExplicitSource< Type > Class Template Reference

Time activated explicit source. More...

#include <finiteVolume/TimeActivatedExplicitSource_.H>


Detailed Description

template<class Type>
class Foam::TimeActivatedExplicitSource< Type >

Time activated explicit source.

Sources described by:

{ active true; // on/off switch timeStart 0.2; // start time duration2.0; // duration selectionMode points;// cellSet/cellZone/all volumeMode absolute; // specific

fieldData // field data - usage for multiple fields ( (H2O 0.005) );

fieldData 0.005; // field data - usage for single field

points // list of points when selectionMode = points ( (2.75 0.5 0) );

cellSet c0;// cellSet name when selectionMode=cellSet cellZonec0;// cellZone name when selectionMode=cellZone }

Source files

Definition at line 94 of file TimeActivatedExplicitSource_.H.

+ Collaboration diagram for TimeActivatedExplicitSource< Type >:

List of all members.

Classes

class  iNew
 Return pointer to new TimeActivatedExplicitSource object created. More...

Public Types

enum  selectionModeType { smPoints, smCellSet, smCellZone, smAll }
 Enumeration for selection mode types. More...
enum  volumeModeType { vmAbsolute, vmSpecific }
 Enumeration for volume types. More...

Public Member Functions

 TimeActivatedExplicitSource (const word &name, const dictionary &dict, const fvMesh &mesh, const wordList &fieldNames)
 Construct from components.
autoPtr
< TimeActivatedExplicitSource
clone () const
 Return clone.
const wordname () const
 Return const access to the source name.
const fvMeshmesh () const
 Return const access to the mesh database.
bool active () const
 Return const access to the source active flag.
scalar timeStart () const
 Return const access to the time start.
scalar duration () const
 Return const access to the duration.
scalar timeEnd () const
 Return const access to the time end.
const volumeModeTypevolumeMode () const
 Return const access to the volume mode.
const selectionModeTypeselectionMode () const
 Return const access to the cell selection mode.
const List< point > & points () const
 Return const access to the list of points for "points".
const wordcellSetName () const
 Return const access to the name of cell set for "cellSet".
scalar V () const
 Return const access to the total cell volume.
const labelListcells () const
 Return const access to the cell set.
const List< fieldNameValuePair > & fieldData () const
 Return const access to the source field name vs value pairs.
const labelListfieldIds () const
 Return const access to the the map of fields ids from supplied.
wordname ()
 Return access to the source name.
bool & active ()
 Return access to the source active flag.
scalar & timeStart ()
 Return access to the time start.
scalar & duration ()
 Return access to the duration.
volumeModeTypevolumeMode ()
 Return access to the volume mode.
selectionModeTypeselectionMode ()
 Return access to the cell selection mode.
List< point > & points ()
 Return access to the list of points for "points" selectionMode.
wordcellSetName ()
 Return access to the name of cell set for "cellSet".
scalar & V ()
 Return access to the total cell volume.
labelListcells ()
 Return access to the cell set.
List< fieldNameValuePair > & fieldData ()
 Return access to the source field name vs value pairs.
labelListfieldIds ()
 Return access to the the map of fields ids from supplied.
void addToField (DimensionedField< Type, volMesh > &Su, const label fieldI)
 Add the source contribution to field Su.
void writeData (Ostream &) const
 Write the source properties.

Static Public Attributes

static const wordList selectionModeTypeNames_
 Word list of selection mode type names.
static const wordList volumeModeTypeNames_
 Word list of volume mode type names.

Protected Types

typedef Tuple2< word, Type > fieldNameValuePair

Protected Member Functions

selectionModeType wordToSelectionModeType (const word &smtName) const
 Helper function to convert from a word to a selectionModeType.
volumeModeType wordToVolumeModeType (const word &vtName) const
 Helper function to convert from a word to a volumeModeType.
word selectionModeTypeToWord (const selectionModeType &smtType) const
 Helper function to convert from a selectionModeType to a word.
word volumeModeTypeToWord (const volumeModeType &vtType) const
 Helper function to convert from a volumeModeType to a word.
void setSelection (const dictionary &dict)
 Set the cellSet or points selection.
void setFieldData (const dictionary &dict, const wordList &fieldNames)
 Set the local field data.
void setCellSet ()
 Set the cell set based on the user input selection mode.

Protected Attributes

word name_
 Source name.
const fvMeshmesh_
 Reference to the mesh database.
bool active_
 Source active flag.
scalar timeStart_
 Time start.
scalar duration_
 Duration.
volumeModeType volumeMode_
 Volume mode.
selectionModeType selectionMode_
 Cell selection mode.
List< pointpoints_
 List of points for "points" selectionMode.
word cellSetName_
 Name of cell set for "cellSet" and "cellZone" selectionMode.
labelList cells_
 Set of cells to apply source to.
scalar V_
 Sum of cell volumes.
List< fieldNameValuePairfieldData_
 List of source field name vs value pairs.
labelList fieldIds_
 Map of fields ids from supplied fields to local field source ids.

Friends

Ostreamoperator (Ostream &os, const TimeActivatedExplicitSource &source)
 Ostream operator.

Member Typedef Documentation

typedef Tuple2<word, Type> fieldNameValuePair
protected

Definition at line 127 of file TimeActivatedExplicitSource_.H.


Member Enumeration Documentation

Enumeration for selection mode types.

Enumerator:
smPoints 
smCellSet 
smCellZone 
smAll 

Definition at line 101 of file TimeActivatedExplicitSource_.H.

Enumeration for volume types.

Enumerator:
vmAbsolute 
vmSpecific 

Definition at line 113 of file TimeActivatedExplicitSource_.H.


Constructor & Destructor Documentation

TimeActivatedExplicitSource ( const word name,
const dictionary dict,
const fvMesh mesh,
const wordList fieldNames 
)

Construct from components.

Definition at line 320 of file TimeActivatedExplicitSource_.C.

References dictionary::lookup(), and List< T >::size().

Referenced by TimeActivatedExplicitSource< Type >::iNew::operator()().


Member Function Documentation

Foam::TimeActivatedExplicitSource< Type >::selectionModeType wordToSelectionModeType ( const word smtName) const
protected

Helper function to convert from a word to a selectionModeType.

Definition at line 53 of file TimeActivatedExplicitSource_.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, and Foam::nl.

Foam::TimeActivatedExplicitSource< Type >::volumeModeType wordToVolumeModeType ( const word vtName) const
protected

Helper function to convert from a word to a volumeModeType.

Definition at line 83 of file TimeActivatedExplicitSource_.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, and Foam::nl.

Foam::word selectionModeTypeToWord ( const selectionModeType smtType) const
protected

Helper function to convert from a selectionModeType to a word.

Definition at line 109 of file TimeActivatedExplicitSource_.C.

Foam::word volumeModeTypeToWord ( const volumeModeType vtType) const
protected

Helper function to convert from a volumeModeType to a word.

Definition at line 126 of file TimeActivatedExplicitSource_.C.

void setSelection ( const dictionary dict)
protected

Set the cellSet or points selection.

Definition at line 143 of file TimeActivatedExplicitSource_.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, and dictionary::lookup().

void setFieldData ( const dictionary dict,
const wordList fieldNames 
)
protected

Set the local field data.

Definition at line 184 of file TimeActivatedExplicitSource_.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, dictionary::lookup(), and Foam::nl.

autoPtr<TimeActivatedExplicitSource> clone ( ) const
inline

Return clone.

Definition at line 207 of file TimeActivatedExplicitSource_.H.

References notImplemented.

const Foam::word & name ( ) const
inline

Return const access to the source name.

Definition at line 31 of file TimeActivatedExplicitSourceI.H.

Referenced by TimeActivatedExplicitSource< Type >::iNew::operator()().

const Foam::fvMesh & mesh ( ) const
inline

Return const access to the mesh database.

Definition at line 38 of file TimeActivatedExplicitSourceI.H.

bool active ( ) const
inline

Return const access to the source active flag.

Definition at line 45 of file TimeActivatedExplicitSourceI.H.

Foam::scalar timeStart ( ) const
inline

Return const access to the time start.

Definition at line 52 of file TimeActivatedExplicitSourceI.H.

Foam::scalar duration ( ) const
inline

Return const access to the duration.

Definition at line 59 of file TimeActivatedExplicitSourceI.H.

Foam::scalar timeEnd ( ) const
inline

Return const access to the time end.

Definition at line 66 of file TimeActivatedExplicitSourceI.H.

const Foam::TimeActivatedExplicitSource< Type >::volumeModeType & volumeMode ( ) const
inline

Return const access to the volume mode.

Definition at line 74 of file TimeActivatedExplicitSourceI.H.

const Foam::TimeActivatedExplicitSource< Type >::selectionModeType & selectionMode ( ) const
inline

Return const access to the cell selection mode.

Definition at line 83 of file TimeActivatedExplicitSourceI.H.

const Foam::List< Foam::point > & points ( ) const
inline

Return const access to the list of points for "points".

selectionMode

Definition at line 91 of file TimeActivatedExplicitSourceI.H.

const Foam::word & cellSetName ( ) const
inline

Return const access to the name of cell set for "cellSet".

selectionMode

Definition at line 99 of file TimeActivatedExplicitSourceI.H.

Foam::scalar V ( ) const
inline

Return const access to the total cell volume.

Definition at line 106 of file TimeActivatedExplicitSourceI.H.

const Foam::labelList & cells ( ) const
inline

Return const access to the cell set.

Definition at line 114 of file TimeActivatedExplicitSourceI.H.

const Foam::List< typename Foam::TimeActivatedExplicitSource< Type >::fieldNameValuePair > & fieldData ( ) const
inline

Return const access to the source field name vs value pairs.

Definition at line 123 of file TimeActivatedExplicitSourceI.H.

const Foam::labelList & fieldIds ( ) const
inline

Return const access to the the map of fields ids from supplied.

fields to local field source ids

Definition at line 131 of file TimeActivatedExplicitSourceI.H.

Foam::word & name ( )
inline

Return access to the source name.

Definition at line 138 of file TimeActivatedExplicitSourceI.H.

bool & active ( )
inline

Return access to the source active flag.

Definition at line 145 of file TimeActivatedExplicitSourceI.H.

Foam::scalar & timeStart ( )
inline

Return access to the time start.

Definition at line 152 of file TimeActivatedExplicitSourceI.H.

Foam::scalar & duration ( )
inline

Return access to the duration.

Definition at line 159 of file TimeActivatedExplicitSourceI.H.

Foam::TimeActivatedExplicitSource< Type >::volumeModeType & volumeMode ( )
inline

Return access to the volume mode.

Definition at line 167 of file TimeActivatedExplicitSourceI.H.

Foam::TimeActivatedExplicitSource< Type >::selectionModeType & selectionMode ( )
inline

Return access to the cell selection mode.

Definition at line 175 of file TimeActivatedExplicitSourceI.H.

Foam::List< Foam::point > & points ( )
inline

Return access to the list of points for "points" selectionMode.

Definition at line 183 of file TimeActivatedExplicitSourceI.H.

Foam::word & cellSetName ( )
inline

Return access to the name of cell set for "cellSet".

selectionMode

Definition at line 190 of file TimeActivatedExplicitSourceI.H.

Foam::scalar & V ( )
inline

Return access to the total cell volume.

Definition at line 197 of file TimeActivatedExplicitSourceI.H.

Foam::labelList & cells ( )
inline

Return access to the cell set.

Definition at line 204 of file TimeActivatedExplicitSourceI.H.

Foam::List< typename Foam::TimeActivatedExplicitSource< Type >::fieldNameValuePair > & fieldData ( )
inline

Return access to the source field name vs value pairs.

Definition at line 212 of file TimeActivatedExplicitSourceI.H.

Foam::labelList & fieldIds ( )
inline

Return access to the the map of fields ids from supplied.

fields to local field source ids

Definition at line 219 of file TimeActivatedExplicitSourceI.H.

void addToField ( DimensionedField< Type, volMesh > &  Su,
const label  fieldI 
)

Add the source contribution to field Su.

Definition at line 360 of file TimeActivatedExplicitSource_.C.

References forAll.

void writeData ( Ostream os) const

Friends And Related Function Documentation

Ostream& operator ( Ostream os,
const TimeActivatedExplicitSource< Type > &  source 
)
friend

Ostream operator.


Member Data Documentation

const Foam::wordList selectionModeTypeNames_
static

Word list of selection mode type names.

Definition at line 110 of file TimeActivatedExplicitSource_.H.

const Foam::wordList volumeModeTypeNames_
static

Word list of volume mode type names.

Definition at line 120 of file TimeActivatedExplicitSource_.H.

word name_
protected

Source name.

Definition at line 130 of file TimeActivatedExplicitSource_.H.

const fvMesh& mesh_
protected

Reference to the mesh database.

Definition at line 133 of file TimeActivatedExplicitSource_.H.

bool active_
protected

Source active flag.

Definition at line 136 of file TimeActivatedExplicitSource_.H.

scalar timeStart_
protected

Time start.

Definition at line 139 of file TimeActivatedExplicitSource_.H.

scalar duration_
protected

Duration.

Definition at line 142 of file TimeActivatedExplicitSource_.H.

volumeModeType volumeMode_
protected

Volume mode.

Definition at line 145 of file TimeActivatedExplicitSource_.H.

selectionModeType selectionMode_
protected

Cell selection mode.

Definition at line 148 of file TimeActivatedExplicitSource_.H.

List<point> points_
protected

List of points for "points" selectionMode.

Definition at line 151 of file TimeActivatedExplicitSource_.H.

word cellSetName_
protected

Name of cell set for "cellSet" and "cellZone" selectionMode.

Definition at line 154 of file TimeActivatedExplicitSource_.H.

labelList cells_
protected

Set of cells to apply source to.

Definition at line 157 of file TimeActivatedExplicitSource_.H.

scalar V_
protected

Sum of cell volumes.

Definition at line 160 of file TimeActivatedExplicitSource_.H.

List<fieldNameValuePair> fieldData_
protected

List of source field name vs value pairs.

Definition at line 163 of file TimeActivatedExplicitSource_.H.

labelList fieldIds_
protected

Map of fields ids from supplied fields to local field source ids.

Definition at line 166 of file TimeActivatedExplicitSource_.H.


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