ENH: set 'applied' flag to field sources when applied

This commit is contained in:
andy
2011-11-02 12:59:42 +00:00
parent f18f1ca15c
commit 3dcc83c444
8 changed files with 26 additions and 15 deletions

View File

@ -112,7 +112,7 @@ Foam::label Foam::actuationDiskSource::applyToField
void Foam::actuationDiskSource::addSup void Foam::actuationDiskSource::addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label const label fieldI
) )
{ {
bool compressible = false; bool compressible = false;
@ -150,6 +150,8 @@ void Foam::actuationDiskSource::addSup
); );
} }
} }
basicSource::addSup(eqn, fieldI);
} }

View File

@ -201,6 +201,7 @@ Foam::basicSource::basicSource
dict_(dict), dict_(dict),
coeffs_(dict.subDict(modelType + "Coeffs")), coeffs_(dict.subDict(modelType + "Coeffs")),
active_(readBool(dict_.lookup("active"))), active_(readBool(dict_.lookup("active"))),
applied_(false),
timeStart_(readScalar(dict_.lookup("timeStart"))), timeStart_(readScalar(dict_.lookup("timeStart"))),
duration_(readScalar(dict_.lookup("duration"))), duration_(readScalar(dict_.lookup("duration"))),
selectionMode_ selectionMode_
@ -276,13 +277,13 @@ bool Foam::basicSource::isActive()
void Foam::basicSource::addSup(fvMatrix<scalar>& eqn, const label fieldI) void Foam::basicSource::addSup(fvMatrix<scalar>& eqn, const label fieldI)
{ {
// do nothing applied_ = true;
} }
void Foam::basicSource::addSup(fvMatrix<vector>& eqn, const label fieldI) void Foam::basicSource::addSup(fvMatrix<vector>& eqn, const label fieldI)
{ {
// do nothing applied_ = true;
} }
@ -292,31 +293,31 @@ void Foam::basicSource::addSup
const label fieldI const label fieldI
) )
{ {
// do nothing applied_ = true;
} }
void Foam::basicSource::addSup(fvMatrix<symmTensor>& eqn, const label fieldI) void Foam::basicSource::addSup(fvMatrix<symmTensor>& eqn, const label fieldI)
{ {
// do nothing applied_ = true;
} }
void Foam::basicSource::addSup(fvMatrix<tensor>& eqn, const label fieldI) void Foam::basicSource::addSup(fvMatrix<tensor>& eqn, const label fieldI)
{ {
// do nothing applied_ = true;
} }
void Foam::basicSource::setValue(fvMatrix<scalar>& eqn, const label fieldI) void Foam::basicSource::setValue(fvMatrix<scalar>& eqn, const label fieldI)
{ {
// do nothing applied_ = true;
} }
void Foam::basicSource::setValue(fvMatrix<vector>& eqn, const label fieldI) void Foam::basicSource::setValue(fvMatrix<vector>& eqn, const label fieldI)
{ {
// do nothing applied_ = true;
} }
@ -326,7 +327,7 @@ void Foam::basicSource::setValue
const label fieldI const label fieldI
) )
{ {
// do nothing applied_ = true;
} }
@ -336,13 +337,13 @@ void Foam::basicSource::setValue
const label fieldI const label fieldI
) )
{ {
// do nothing applied_ = true;
} }
void Foam::basicSource::setValue(fvMatrix<tensor>& eqn, const label fieldI) void Foam::basicSource::setValue(fvMatrix<tensor>& eqn, const label fieldI)
{ {
// do nothing applied_ = true;
} }

View File

@ -98,7 +98,7 @@ protected:
bool active_; bool active_;
//- Flag to indicate whether or not the source has been applied //- Flag to indicate whether or not the source has been applied
// bool applied_; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! bool applied_;
//- Time start //- Time start
scalar timeStart_; scalar timeStart_;

View File

@ -124,6 +124,8 @@ void Foam::ExplicitSetValue<Type>::setValue
} }
eqn.setValues(cells_, values); eqn.setValues(cells_, values);
basicSource::setValue(eqn, fieldI);
} }

View File

@ -184,6 +184,8 @@ void Foam::ExplicitSource<Type>::addSup
} }
eqn -= Su; eqn -= Su;
basicSource::addSup(eqn, fieldI);
} }

View File

@ -64,7 +64,7 @@ Foam::radialActuationDiskSource::radialActuationDiskSource
void Foam::radialActuationDiskSource::addSup void Foam::radialActuationDiskSource::addSup
( (
fvMatrix<vector>& eqn, fvMatrix<vector>& eqn,
const label const label fieldI
) )
{ {
bool compressible = false; bool compressible = false;
@ -102,6 +102,8 @@ void Foam::radialActuationDiskSource::addSup
); );
} }
} }
basicSource::addSup(eqn, fieldI);
} }

View File

@ -411,7 +411,7 @@ Foam::label Foam::rotorDiskSource::applyToField(const word& fieldName) const
} }
void Foam::rotorDiskSource::addSup(fvMatrix<vector>& eqn) void Foam::rotorDiskSource::addSup(fvMatrix<vector>& eqn, const label fieldI)
{ {
// add source to lhs of eqn // add source to lhs of eqn
@ -440,6 +440,8 @@ void Foam::rotorDiskSource::addSup(fvMatrix<vector>& eqn)
dimForce/dimVolume/dimDensity dimForce/dimVolume/dimDensity
); );
} }
basicSource::addSup(eqn, fieldI);
} }

View File

@ -273,7 +273,7 @@ public:
// Source term addition // Source term addition
//- Source term to fvMatrix<vector> //- Source term to fvMatrix<vector>
virtual void addSup(fvMatrix<vector>& eqn); virtual void addSup(fvMatrix<vector>& eqn, const label fieldI);
// I-O // I-O