Go to the documentation of this file.
38 namespace functionObjects
49 Foam::functionObjects::electricPotential::operandField()
51 if (!foundObject<volScalarField>(fieldName_))
65 store(fieldName_, tfldPtr);
68 return lookupObjectRef<volScalarField>(fieldName_);
73 Foam::functionObjects::electricPotential::sigma()
const
75 const IOobject sigmaIO
78 mesh_.time().timeName(),
87 tmp<volScalarField> tsigma = phases_[0]*sigmas_[0];
89 for (label i = 1; i < phases_.size(); ++i)
91 tsigma.ref() += phases_[i]*sigmas_[i];
98 calculatedFvPatchField<scalar>::typeName
107 calculatedFvPatchField<scalar>::typeName
113 Foam::functionObjects::electricPotential::epsilonm()
const
122 const IOobject epsilonrIO
125 mesh_.time().timeName(),
134 tmp<volScalarField> tepsilonr = phases_[0]*epsilonrs_[0];
136 for (label i = 1; i < phases_.size(); ++i)
138 tepsilonr.ref() += phases_[i]*epsilonrs_[i];
145 calculatedFvPatchField<scalar>::typeName
154 calculatedFvPatchField<scalar>::typeName
161 Foam::functionObjects::electricPotential::electricPotential
169 phasesDict_(
dict.subOrEmptyDict(
"phases")),
178 dict.getCheckOrDefault<scalar>
192 dict.getCheckOrDefault<scalar>
209 writeDerivedFields_(
false)
228 dict.readIfPresent(
"sigma", sigma_);
229 dict.readIfPresent(
"epsilonr", epsilonr_);
230 dict.readIfPresent(
"nCorr", nCorr_);
231 dict.readIfPresent(
"writeDerivedFields", writeDerivedFields_);
234 if (!phasesDict_.empty())
236 phaseNames_.setSize(phasesDict_.size());
237 phases_.setSize(phasesDict_.size());
238 sigmas_.setSize(phasesDict_.size());
240 if (writeDerivedFields_)
242 epsilonrs_.setSize(phasesDict_.size());
246 for (
const entry& dEntry : phasesDict_)
248 const word&
key = dEntry.keyword();
250 if (!dEntry.isDict())
253 <<
"Entry " <<
key <<
" is not a dictionary" <<
nl
275 if (writeDerivedFields_)
321 for (label i = 1; i <= nCorr_; ++i)
347 if (writeDerivedFields_)
355 mesh_.time().timeName(),
378 mesh_.time().timeName(),
401 mesh_.time().timeName(),
A keyword and a list of tokens is an 'entry'.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
A class for managing temporary objects.
virtual bool read(const dictionary &dict)
Read the function object data.
bool read(const char *buf, int32_t &val)
Same as readInt32.
static word timeName(const scalar t, const int precision=precision_)
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool store(word &fieldName, const tmp< ObjectType > &tfield, bool cacheable=false)
Store the field in the (sub) objectRegistry under the given name.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const dimensionedScalar epsilon0
Electric constant: default SI units: [F/m].
#define forAll(list, i)
Loop across all elements in list.
const dimensionSet dimCurrent(0, 0, 0, 0, 0, 1, 0)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
dimensionedScalar pow4(const dimensionedScalar &ds)
dimensionedScalar pow3(const dimensionedScalar &ds)
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool read(const dictionary &dict)
Read optional controls.
Macros for easy insertion into run-time selection tables.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
void correctBoundaryConditions()
Correct boundary field.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
static MinMax< T > ge(const T &minVal)
A semi-infinite range from minVal to the type max.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const fvMesh & mesh_
Reference to the fvMesh.
const dimensionedScalar e
Elementary charge.
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
defineTypeNameAndDebug(ObukhovLength, 0)
T getCheck(const word &keyword, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
A special matrix type and solver, designed for finite volume solutions of scalar equations....
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const Time & time() const
Return the top-level database.
virtual bool execute()
Calculate the function object.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
virtual bool write()
Write the function object output.
const dimensionSet dimless
Dimensionless.