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.
virtual ~basicSource | ( | ) | [inline, virtual]
|
Destructor.
Definition at line 263 of file basicSource.H.
Foam::basicSource::selectionModeType wordToSelectionModeType | ( | const word & | smtName ) | const [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.
Foam::word selectionModeTypeToWord | ( | const selectionModeType & | smtType ) | const [protected]
|
Helper function to convert from a selectionModeType to a word.
Definition at line 79 of file basicSource.C.
Referenced by basicSource::writeData().
void setSelection | ( | const dictionary & | dict ) | [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.
void setCellSet | ( | ) | [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) | |||
) |
autoPtr<basicSource> clone | ( | ) | const [inline]
|
Return clone.
Reimplemented in explicitSource.
Definition at line 204 of file basicSource.H.
References notImplemented.
Foam::autoPtr< Foam::basicSource > New | ( | const word & | name, |
const dictionary & | dict, | ||
const fvMesh & | mesh | ||
) | [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()().
const Foam::word & name | ( | ) | const [inline]
|
Return const access to the source name.
Definition at line 30 of file basicSourceI.H.
References basicSource::name_.
const Foam::fvMesh & mesh | ( | ) | const [inline]
|
Return const access to the mesh database.
Definition at line 36 of file basicSourceI.H.
Referenced by explicitSource::setSelectedCellsFromPoints().
const Foam::dictionary & dictCoeffs | ( | ) | const [inline]
|
Return dictionay.
Definition at line 41 of file basicSourceI.H.
bool active | ( | ) | const [inline]
|
Return const access to the source active flag.
Definition at line 46 of file basicSourceI.H.
Foam::scalar timeStart | ( | ) | const [inline]
|
Return const access to the time start.
Definition at line 52 of file basicSourceI.H.
Foam::scalar duration | ( | ) | const [inline]
|
Return const access to the duration.
Definition at line 58 of file basicSourceI.H.
Foam::scalar timeEnd | ( | ) | const [inline]
|
Return const access to the time end.
Definition at line 64 of file basicSourceI.H.
const Foam::basicSource::selectionModeType & selectionMode | ( | ) | const [inline]
|
Return const access to the cell selection mode.
Definition at line 71 of file basicSourceI.H.
const Foam::word & cellSetName | ( | ) | const [inline]
|
Return const access to the name of cell set for "cellSet".
selectionMode
Definition at line 77 of file basicSourceI.H.
Foam::scalar V | ( | ) | const [inline]
|
Return const access to the total cell volume.
Definition at line 83 of file basicSourceI.H.
const Foam::labelList & cells | ( | ) | const [inline]
|
Return const access to the cell set.
Definition at line 89 of file basicSourceI.H.
Referenced by explicitSource::setSelectedCellsFromPoints().
Foam::word & name | ( | ) | [inline]
|
Return access to the source name.
Definition at line 95 of file basicSourceI.H.
bool & active | ( | ) | [inline]
|
Return access to the source active flag.
Definition at line 101 of file basicSourceI.H.
Foam::scalar & timeStart | ( | ) | [inline]
|
Return access to the time start.
Definition at line 107 of file basicSourceI.H.
Foam::scalar & duration | ( | ) | [inline]
|
Return access to the duration.
Definition at line 113 of file basicSourceI.H.
Foam::basicSource::selectionModeType & selectionMode | ( | ) | [inline]
|
Return access to the cell selection mode.
Definition at line 126 of file basicSourceI.H.
Foam::word & cellSetName | ( | ) | [inline]
|
Return access to the name of cell set for "cellSet".
selectionMode
Definition at line 119 of file basicSourceI.H.
Foam::scalar & V | ( | ) | [inline]
|
Return access to the total cell volume.
Definition at line 132 of file basicSourceI.H.
Foam::labelList & cells | ( | ) | [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.
virtual void addExplicitSources | ( | ) | [pure virtual]
|
Add all explicit sources.
Implemented in actuationDiskSource, and explicitSource.
virtual void addSu | ( | DimensionedField< scalar, volMesh > & | field ) | [pure virtual]
|
Add source to scalar field.
Implemented in actuationDiskSource, and explicitSource.
Referenced by basicSourceList::addSu().
virtual void addSu | ( | DimensionedField< vector, volMesh > & | field ) | [pure virtual]
|
Add source to vector field.
Implemented in actuationDiskSource, and explicitSource.
Add source term to vector fvMatrix.
Implemented in actuationDiskSource, and explicitSource.
virtual void addSu | ( | fvMatrix< scalar > & | Eqn ) | [pure virtual]
|
Add source term to scalar fvMatrix.
Implemented in actuationDiskSource, and explicitSource.
void writeData | ( | Ostream & | os ) | const [pure virtual]
|
Write the source properties.
Implemented in actuationDiskSource, and explicitSource.
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().
bool read | ( | const dictionary & | dict ) | [pure virtual]
|
Read source dictionary.
Implemented in actuationDiskSource, and explicitSource.
Definition at line 72 of file basicSourceIO.C.
References dictionary::lookup(), Foam::readBool(), Foam::readScalar(), and dictionary::subDict().
Referenced by explicitSource::read(), and actuationDiskSource::read().
const Foam::wordList selectionModeTypeNames_ [static]
|
Word list of selection mode type names.
Definition at line 118 of file basicSource.H.
Referenced by basicSource::setSelection().
Source name.
Definition at line 126 of file basicSource.H.
Referenced by basicSource::name(), explicitSource::writeData(), and basicSource::writeData().
Reference to the mesh database.
Definition at line 129 of file basicSource.H.
const dictionary& dict_ [protected]
|
Dictionary containing the data of the source.
Reimplemented in explicitSource.
Definition at line 132 of file basicSource.H.
bool active_ [protected]
|
Source active flag.
Definition at line 135 of file basicSource.H.
Referenced by basicSource::writeData().
scalar timeStart_ [protected]
|
scalar duration_ [protected]
|
selectionModeType selectionMode_ [protected]
|
Cell selection mode.
Definition at line 144 of file basicSource.H.
Referenced by basicSource::setSelection(), and basicSource::writeData().
word cellSetName_ [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().
Set of cells to apply source to.
Definition at line 150 of file basicSource.H.
scalar V_ [protected]
|
Sum of cell volumes.
Definition at line 153 of file basicSource.H.