51 Foam::fv::jouleHeatingSource::transformSigma
64 auto&
sigma = tsigma.ref();
70 <<
"Coordinate system undefined" 74 const auto& csys = *csysPtr_;
78 sigma.primitiveFieldRef() =
79 csys.transformPrincipal(sigmaLocal);
83 sigma.primitiveFieldRef() =
87 sigma.correctBoundaryConditions();
97 const word& sourceName,
98 const word& modelType,
109 IOobject::scopedName(typeName,
"V"),
118 anisotropicElectricalConductivity_(false),
119 scalarSigmaVsTPtr_(nullptr),
120 vectorSigmaVsTPtr_(nullptr),
148 if (curTimeIndex_ != mesh_.time().timeIndex())
150 if (anisotropicElectricalConductivity_)
153 const volVectorField& sigmaLocal = updateSigma(vectorSigmaVsTPtr_);
173 curTimeIndex_ = mesh_.time().timeIndex();
183 if (anisotropicElectricalConductivity_)
185 const auto& sigmaLocal = mesh_.lookupObject<
volVectorField>(sigmaName);
187 tmp<volSymmTensorField>
sigma = transformSigma(sigmaLocal);
189 eqn += (
sigma & gradV) & gradV;
195 eqn += (
sigma*gradV) & gradV;
204 coeffs_.readIfPresent(
"T", TName_);
206 anisotropicElectricalConductivity_ =
207 coeffs_.get<
bool>(
"anisotropicElectricalConductivity");
209 if (anisotropicElectricalConductivity_)
211 Info<<
" Using vector electrical conductivity" <<
endl;
213 initialiseSigma(coeffs_, vectorSigmaVsTPtr_);
216 coordinateSystem::New
220 coordinateSystem::typeName
225 Info<<
" Using scalar electrical conductivity" <<
endl;
227 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.
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.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
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 expressions::valueTypeCode::INVALID.
Calculate the gradient of the given field.
A class for handling words, derived from Foam::string.
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...
static tmp< GeometricField< symmTensor, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< symmTensor >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
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)