47 const Foam::word Foam::fv::jouleHeatingSource::sigmaName(typeName +
":sigma");
53 Foam::fv::jouleHeatingSource::transformSigma
73 auto&
sigma = tsigma.ref();
79 <<
"Coordinate system undefined" 83 const auto& csys = *csysPtr_;
87 sigma.primitiveFieldRef() =
88 csys.transformPrincipal(sigmaLocal);
92 sigma.primitiveFieldRef() =
96 sigma.correctBoundaryConditions();
106 const word& sourceName,
107 const word& modelType,
126 anisotropicElectricalConductivity_(false),
127 scalarSigmaVsTPtr_(nullptr),
128 vectorSigmaVsTPtr_(nullptr),
156 if (curTimeIndex_ != mesh_.time().timeIndex())
158 if (anisotropicElectricalConductivity_)
161 const volVectorField& sigmaLocal = updateSigma(vectorSigmaVsTPtr_);
181 curTimeIndex_ = mesh_.time().timeIndex();
187 if (anisotropicElectricalConductivity_)
189 const auto& sigmaLocal = mesh_.lookupObject<
volVectorField>(sigmaName);
191 tmp<volSymmTensorField>
sigma = transformSigma(sigmaLocal);
193 eqn += (
sigma & gradV) & gradV;
199 eqn += (
sigma*gradV) & gradV;
208 coeffs_.readIfPresent(
"T", TName_);
210 anisotropicElectricalConductivity_ =
211 coeffs_.get<
bool>(
"anisotropicElectricalConductivity");
213 if (anisotropicElectricalConductivity_)
215 Info<<
" Using vector electrical conductivity" <<
endl;
217 initialiseSigma(coeffs_, vectorSigmaVsTPtr_);
220 coordinateSystem::New
224 coordinateSystem::typeName
229 Info<<
" Using scalar electrical conductivity" <<
endl;
231 initialiseSigma(coeffs_, scalarSigmaVsTPtr_);
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
word dictName() const
The local dictionary name (final part of scoped name)
virtual bool read(const dictionary &dict)
Read source dictionary.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
Abstract base-class for fluid and solid thermodynamic properties.
wordList fieldNames_
Field names to apply source to - populated by derived models.
void resize(const label len)
Adjust allocated size of list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvMesh & mesh_
Reference to the mesh database.
const word & name() const noexcept
Return the object name.
jouleHeatingSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Calculate the matrix for the laplacian of the field.
Ignore writing from objectRegistry::writeObject()
const Time & time() const
Return the top-level database.
GeometricField< vector, fvPatchField, volMesh > volVectorField
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Macros for easy insertion into run-time selection tables.
virtual void addSup(const volScalarField &rho, fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to compressible momentum equation.
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Calculate the gradient of the given field.
A class for handling words, derived from Foam::string.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
virtual bool read(const dictionary &dict)
Read source dictionary.
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.
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
#define DebugInfo
Report an information message using Foam::Info.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
dimensioned< symmTensor > dimensionedSymmTensor
Dimensioned tensor obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Mesh data needed to do the Finite Volume discretisation.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
messageStream Info
Information stream (stdout output on master, null elsewhere)
A class for managing temporary objects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Do not request registration (bool: false)
Base abstract class for handling finite volume options (i.e. fvOption).
static constexpr const zero Zero
Global zero (0)