Basic source abtract class. More...
#include <finiteVolume/basicSource.H>
Basic source abtract class.
source1 { typeModel actuationDiskSource; // explicitSource active on;// on/off switch timeStart 0.0; // start time duration1000.0;// duration selectionMode cellSet; // cellSet // points //cellZone cellSet c0;// cellSet name
actuationDiskSourceCoeffs { diskDir (-1 0 0); // orientation of the disk Cp 0.53; // Cp Ct 0.58; // Ct diskArea40; // disk area } }
source2 { typeModel explicitSource; active on; timeStart 0.0; duration1000.0; selectionMode points; cellSet c0;
explicitSourceCoeffs { points// list of points when selectionMode = points ( (-0.088 0.007 -0.02) (-0.028 0.007 -0.02) ); volumeMode specific; //absolute fieldData //field data { k 30.7; epsilon 1.5; } } }
Definition at line 102 of file basicSource.H.
Classes | |
class | iNew |
Return pointer to new basicSource object created. More... |
Public Types | |
enum | selectionModeType { smPoints, smCellSet, smCellZone, smAll } |
Enumeration for selection mode types. More... |
Public Member Functions | |
TypeName ("basicSource") | |
Runtime type information. | |
declareRunTimeSelectionTable (autoPtr, basicSource, dictionary,(const word &name, const dictionary &dict, const fvMesh &mesh),(name, dict, mesh)) | |
basicSource (const word &name, const dictionary &dict, const fvMesh &mesh) | |
Construct from components. | |
autoPtr< basicSource > | clone () const |
Return clone. | |
virtual | ~basicSource () |
Destructor. | |
const word & | name () const |
Return const access to the source name. | |
const fvMesh & | mesh () const |
Return const access to the mesh database. | |
const dictionary & | dictCoeffs () const |
Return dictionay. | |
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 selectionModeType & | selectionMode () const |
Return const access to the cell selection mode. | |
const word & | cellSetName () const |
Return const access to the name of cell set for "cellSet". | |
scalar | V () const |
Return const access to the total cell volume. | |
const labelList & | cells () const |
Return const access to the cell set. | |
word & | name () |
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. | |
selectionModeType & | selectionMode () |
Return access to the cell selection mode. | |
List< point > & | points () |
Return access to the list of points for "points" selectionMode. | |
word & | cellSetName () |
Return access to the name of cell set for "cellSet". | |
scalar & | V () |
Return access to the total cell volume. | |
labelList & | cells () |
Return access to the cell set. | |
bool | isActive () |
Is the source active? | |
virtual void | addExplicitSources ()=0 |
Add all explicit sources. | |
virtual void | addSu (DimensionedField< scalar, volMesh > &field)=0 |
Add source to scalar field. | |
virtual void | addSu (DimensionedField< vector, volMesh > &field)=0 |
Add source to vector field. | |
virtual void | addSu (fvMatrix< vector > &Eqn)=0 |
Add source term to vector fvMatrix. | |
virtual void | addSu (fvMatrix< scalar > &Eqn)=0 |
Add source term to scalar fvMatrix. | |
virtual void | writeData (Ostream &) const =0 |
Write the source properties. | |
virtual bool | read (const dictionary &dict)=0 |
Read source dictionary. |
Static Public Member Functions | |
static autoPtr< basicSource > | New (const word &name, const dictionary &dict, const fvMesh &mesh) |
Return a reference to the selected basicSource model. |
Static Public Attributes | |
static const wordList | selectionModeTypeNames_ |
Word list of selection mode type names. |
Protected Member Functions | |
selectionModeType | wordToSelectionModeType (const word &smtName) const |
Helper function to convert from a word to a selectionModeType. | |
word | selectionModeTypeToWord (const selectionModeType &smtType) const |
Helper function to convert from a selectionModeType to a word. | |
void | setSelection (const dictionary &dict) |
Set the cellSet or points selection. | |
void | setCellSet () |
Set the cell set based on the user input selection mode. |
Protected Attributes | |
word | name_ |
Source name. | |
const fvMesh & | mesh_ |
Reference to the mesh database. | |
const dictionary & | dict_ |
Dictionary containing the data of the source. | |
bool | active_ |
Source active flag. | |
scalar | timeStart_ |
Time start. | |
scalar | duration_ |
Duration. | |
selectionModeType | selectionMode_ |
Cell selection mode. | |
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. |
enum selectionModeType |
Enumeration for selection mode types.
Definition at line 109 of file basicSource.H.
basicSource | ( | const word & | name, |
const dictionary & | dict, | ||
const fvMesh & | mesh | ||
) |
Construct from components.
Definition at line 203 of file basicSource.C.
|
inlinevirtual |
Destructor.
Definition at line 263 of file basicSource.H.
|
protected |
Helper function to convert from a word to a selectionModeType.
Definition at line 51 of file basicSource.C.
References Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, and Foam::nl.
|
protected |
Helper function to convert from a selectionModeType to a word.
Definition at line 79 of file basicSource.C.
Referenced by basicSource::writeData().
|
protected |
Set the cellSet or points selection.
Definition at line 94 of file basicSource.C.
References basicSource::cellSetName_, Foam::exit(), Foam::FatalError, FatalErrorIn, dictionary::lookup(), basicSource::selectionMode_, basicSource::selectionModeTypeNames_, basicSource::smAll, basicSource::smCellSet, basicSource::smCellZone, and basicSource::smPoints.
|
protected |
Set the cell set based on the user input selection mode.
Definition at line 131 of file basicSource.C.
References Foam::decrIndent(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, Foam::identity(), Foam::incrIndent(), Foam::indent(), Foam::Info, Foam::nl, Foam::reduce(), Foam::returnReduce(), and HashTable< T, Key, Hash >::toc().
TypeName | ( | "basicSource" | ) |
Runtime type information.
declareRunTimeSelectionTable | ( | autoPtr | , |
basicSource | , | ||
dictionary | , | ||
(const word &name, const dictionary &dict, const fvMesh &mesh) | , | ||
(name, dict, mesh) | |||
) |
|
inline |
Return clone.
Reimplemented in explicitSource.
Definition at line 204 of file basicSource.H.
References notImplemented.
|
static |
Return a reference to the selected basicSource model.
Definition at line 228 of file basicSource.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::Info, dictionary::lookup(), mesh, Foam::name(), and Foam::nl.
Referenced by basicSource::iNew::operator()().
|
inline |
Return const access to the source name.
Definition at line 30 of file basicSourceI.H.
References basicSource::name_.
|
inline |
Return const access to the mesh database.
Definition at line 36 of file basicSourceI.H.
Referenced by explicitSource::setSelectedCellsFromPoints().
|
inline |
Return dictionay.
Definition at line 41 of file basicSourceI.H.
|
inline |
Return const access to the source active flag.
Definition at line 46 of file basicSourceI.H.
|
inline |
Return const access to the time start.
Definition at line 52 of file basicSourceI.H.
|
inline |
Return const access to the duration.
Definition at line 58 of file basicSourceI.H.
|
inline |
Return const access to the time end.
Definition at line 64 of file basicSourceI.H.
|
inline |
Return const access to the cell selection mode.
Definition at line 71 of file basicSourceI.H.
|
inline |
Return const access to the name of cell set for "cellSet".
selectionMode
Definition at line 77 of file basicSourceI.H.
|
inline |
Return const access to the total cell volume.
Definition at line 83 of file basicSourceI.H.
|
inline |
Return const access to the cell set.
Definition at line 89 of file basicSourceI.H.
Referenced by explicitSource::setSelectedCellsFromPoints().
|
inline |
Return access to the source name.
Definition at line 95 of file basicSourceI.H.
|
inline |
Return access to the source active flag.
Definition at line 101 of file basicSourceI.H.
|
inline |
Return access to the time start.
Definition at line 107 of file basicSourceI.H.
|
inline |
Return access to the duration.
Definition at line 113 of file basicSourceI.H.
|
inline |
Return access to the cell selection mode.
Definition at line 126 of file basicSourceI.H.
|
inline |
Return access to the name of cell set for "cellSet".
selectionMode
Definition at line 119 of file basicSourceI.H.
|
inline |
Return access to the total cell volume.
Definition at line 132 of file basicSourceI.H.
|
inline |
Return access to the cell set.
Definition at line 138 of file basicSourceI.H.
bool isActive | ( | ) |
Is the source active?
Definition at line 260 of file basicSource.C.
|
pure virtual |
Add all explicit sources.
Implemented in explicitSource, and actuationDiskSource.
|
pure virtual |
Add source to scalar field.
Implemented in explicitSource, and actuationDiskSource.
Referenced by basicSourceList::addSu().
|
pure virtual |
Add source to vector field.
Implemented in explicitSource, and actuationDiskSource.
Add source term to vector fvMatrix.
Implemented in explicitSource, and actuationDiskSource.
|
pure virtual |
Add source term to scalar fvMatrix.
Implemented in explicitSource, and actuationDiskSource.
|
pure virtual |
Write the source properties.
Implemented in explicitSource, and actuationDiskSource.
Definition at line 30 of file basicSourceIO.C.
References Foam::abort(), basicSource::active_, token::BEGIN_BLOCK, basicSource::cellSetName_, Foam::decrIndent(), basicSource::duration_, token::END_BLOCK, token::END_STATEMENT, Foam::endl(), Foam::FatalError, FatalErrorIn, Foam::incrIndent(), Foam::indent(), basicSource::name_, Foam::nl, basicSource::selectionMode_, basicSource::selectionModeTypeToWord(), basicSource::smCellSet, basicSource::smPoints, basicSource::timeStart_, and Ostream::writeKeyword().
|
pure virtual |
Read source dictionary.
Implemented in explicitSource, and actuationDiskSource.
Definition at line 72 of file basicSourceIO.C.
References dictionary::lookup(), Foam::readBool(), Foam::readScalar(), and dictionary::subDict().
Referenced by actuationDiskSource::read(), and explicitSource::read().
|
static |
Word list of selection mode type names.
Definition at line 118 of file basicSource.H.
Referenced by basicSource::setSelection().
|
protected |
Source name.
Definition at line 126 of file basicSource.H.
Referenced by basicSource::name(), explicitSource::writeData(), and basicSource::writeData().
|
protected |
Reference to the mesh database.
Definition at line 129 of file basicSource.H.
|
protected |
Dictionary containing the data of the source.
Reimplemented in explicitSource.
Definition at line 132 of file basicSource.H.
|
protected |
Source active flag.
Definition at line 135 of file basicSource.H.
Referenced by basicSource::writeData().
|
protected |
|
protected |
|
protected |
Cell selection mode.
Definition at line 144 of file basicSource.H.
Referenced by basicSource::setSelection(), and basicSource::writeData().
|
protected |
Name of cell set for "cellSet" and "cellZone" selectionMode.
Definition at line 147 of file basicSource.H.
Referenced by basicSource::setSelection(), and basicSource::writeData().
|
protected |
Set of cells to apply source to.
Definition at line 150 of file basicSource.H.
|
protected |
Sum of cell volumes.
Definition at line 153 of file basicSource.H.