Skip to content
Snippets Groups Projects
Commit a5a641ce authored by andy's avatar andy
Browse files

ENH: Updated fixedTemperature field source (constraint)

parent 62e54128
Branches
Tags
No related merge requests found
......@@ -57,25 +57,33 @@ Foam::fixedTemperatureSource::fixedTemperatureSource
ExplicitSetValue<scalar>(name, modelType, dict, mesh),
T_(readScalar(coeffs_.lookup("temperature")))
{
coeffs_.lookup("fieldNames") >> fieldNames_;
applied_.setSize(fieldNames_.size(), false);
fieldNames_.setSize(1, "energy");
applied_.setSize(1, false);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::fixedTemperatureSource::alwaysApply() const
{
return true;
}
void Foam::fixedTemperatureSource::setValue
(
fvMatrix<scalar>& eqn,
const label fieldI
const label
)
{
const basicThermo& thermo =
mesh_.lookupObject<basicThermo>("thermophsicalProperties");
const scalarField Tfield(cells_.size(), T_);
eqn.setValues(cells_, thermo.he(thermo.p(), Tfield, cells_));
if (eqn.psi().name() == thermo.he().name())
{
const scalarField Tfield(cells_.size(), T_);
eqn.setValues(cells_, thermo.he(thermo.p(), Tfield, cells_));
}
}
......
......@@ -105,6 +105,9 @@ public:
// Member Functions
virtual bool alwaysApply() const;
// Set values directly
//- Scalar
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment