mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: set 'applied' flag to field sources when applied
This commit is contained in:
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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_;
|
||||||
|
|||||||
@ -124,6 +124,8 @@ void Foam::ExplicitSetValue<Type>::setValue
|
|||||||
}
|
}
|
||||||
|
|
||||||
eqn.setValues(cells_, values);
|
eqn.setValues(cells_, values);
|
||||||
|
|
||||||
|
basicSource::setValue(eqn, fieldI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -184,6 +184,8 @@ void Foam::ExplicitSource<Type>::addSup
|
|||||||
}
|
}
|
||||||
|
|
||||||
eqn -= Su;
|
eqn -= Su;
|
||||||
|
|
||||||
|
basicSource::addSup(eqn, fieldI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user