52 void Foam::fv::heatSource::readCoeffs()
54 if (!coeffs().
found(
"q") && !coeffs().
found(
"Q"))
57 <<
"Neither heat source per unit volume, q, or total heat source, " 61 if (coeffs().
found(
"q") && coeffs().
found(
"Q"))
64 <<
"Both heat source per unit volume, q, and total heat source, " 65 <<
"Q, have been specified. One is required." 69 if (coeffs().
found(
"q"))
77 new Function1s::Scale<scalar>
80 Function1s::Constant<scalar>(
"1/V", 1/set_.V()),
81 Function1s::Constant<scalar>(
"1", 1),
94 const word& modelType,
99 fvModel(name, modelType, dict, mesh),
100 set_(coeffs(), mesh),
127 const word& fieldName
132 const scalar t =
mesh().time().value();
133 const scalar q = q_->value(t);
137 eqn.
source()[cells[i]] -=
mesh().V()[cells[i]]*q;
146 const word& fieldName
149 addSup(eqn, fieldName);
virtual ~heatSource()
Destructor.
defineTypeNameAndDebug(fixedTemperatureConstraint, 0)
#define forAll(list, i)
Loop across all elements in list.
const word & name() const
Return name.
fluidReactionThermo & thermo
Base-class for fluid and solid thermodynamic properties.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual bool read(const dictionary &dict)
Read source dictionary.
Finite volume model abstract base class.
Macros for easy insertion into run-time selection tables.
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
virtual void addSup(fvMatrix< scalar > &eqn, const word &fieldName) const
Source term to energy equation.
A class for handling words, derived from string.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
heatSource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from dictionary.
static const word dictName
Name of the thermophysical properties dictionary.
addToRunTimeSelectionTable(fvConstraint, fixedTemperatureConstraint, dictionary)
List< word > wordList
A List of words.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Mesh data needed to do the Finite Volume discretisation.
static autoPtr< Function1< scalar > > New(const word &name, const dictionary &dict)
Selector.