46 void Foam::fv::solidElectricalConduction::readCoeffs(
const dictionary&
dict)
48 const word sigmaKey =
"sigma";
49 const word sigmaScalarKey =
51 const word sigmaTensorKey =
54 const bool haveSigma =
dict.found(sigmaKey);
55 const bool haveScalarSigma =
dict.found(sigmaScalarKey);
56 const bool haveTensorSigma =
dict.found(sigmaTensorKey);
58 const label nHaveSigmas =
64 << (nHaveSigmas ?
"multiple" :
"none")
65 <<
" of keywords " << sigmaKey <<
", " << sigmaScalarKey <<
' '
66 << (nHaveSigmas ?
"and" :
"or") <<
' ' << sigmaTensorKey
67 <<
" defined in dictionary " <<
dict.name()
71 if (haveSigma || haveScalarSigma)
75 new FunctionalGeometricField<scalar, fvMesh>
78 haveSigma ? sigmaKey : sigmaScalarKey,
89 new FunctionalGeometricField<tensor, fvMesh>
100 writeSigma_ =
dict.lookupOrDefault<
bool>(
"writeSigma",
false);
109 const word& modelType,
175 const bool sigmaChanged =
176 sigmaScalarPtr_.valid()
177 ? sigmaScalarPtr_->update()
178 : sigmaTensorPtr_->update();
180 if (sigmaChanged || meshChanged_)
188 for (
label i = 0; i <= nCorr; ++ i)
192 sigmaScalarPtr_.valid()
199 if (i == nCorr) I_ = phiEqn.
flux();
205 meshChanged_ =
false;
220 sigmaScalarPtr_.valid()
221 ? sigmaScalarPtr_->reset()
222 : sigmaTensorPtr_->reset();
230 sigmaScalarPtr_.valid()
231 ? sigmaScalarPtr_->reset()
232 : sigmaTensorPtr_->reset();
240 sigmaScalarPtr_.valid()
241 ? sigmaScalarPtr_->reset()
242 : sigmaTensorPtr_->reset();
252 readCoeffs(coeffs(
dict));
264 if (
write && writeSigma_)
266 sigmaScalarPtr_.valid()
267 ? sigmaScalarPtr_->write()
268 : sigmaTensorPtr_->write();
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const word & name() const
Return name.
Base-class for fluid and solid thermodynamic properties.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
T lookupOrDefault(const word &, const T &) const
Find and return a T, if not found return the given default.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
SolverPerformance< Type > solve(const dictionary &)
Solve segregated or coupled returning the solution statistics.
tmp< SurfaceField< Type > > flux() const
Return the face-flux field from the matrix.
Mesh data needed to do the Finite Volume discretisation.
const fvSchemes & schemes() const
Return the fvSchemes.
const fvSolution & solution() const
Return the fvSolution.
Finite volume model abstract base class.
virtual bool read(const dictionary &dict)
Read source dictionary.
const fvMesh & mesh() const
Return const access to the mesh database.
void setFluxRequired(const word &name) const
This fvModel represents conduction through a solid region. It solves for the electric potential,...
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
solidElectricalConduction(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual void correct()
Solve for the electric potential.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual void addSup(const volScalarField &rho, const volScalarField &he, fvMatrix< scalar > &eqn) const
Add explicit contribution to compressible energy equation.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual bool write(const bool write=true) const
Write fvModel data.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
static bool finalIteration(const objectRegistry ®istry)
Lookup solutionControl from the objectRegistry and return finalIter.
const dictionary & solverDict(const word &name) const
Return the solver controls dictionary for the given field.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Calculate the matrix for the laplacian of the field.
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
tmp< fvMatrix< Type > > laplacian(const VolField< Type > &vf, const word &name)
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet & dimLength
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
const dimensionSet & dimCurrent
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
const dimensionSet & dimPower
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
fluidMulticomponentThermo & thermo