37Foam::electrostaticDepositionFvPatchScalarField::eVPatch
48 refCast<const electrostaticDepositionFvPatchScalarField>(bf[patchi]);
54void Foam::electrostaticDepositionFvPatchScalarField::setMaster()
const
69 if (isA<electrostaticDepositionFvPatchScalarField>(bf[patchi]))
71 electrostaticDepositionFvPatchScalarField& eVpf = eVPatch(patchi);
78 eVpf.master() = master;
84void Foam::electrostaticDepositionFvPatchScalarField::round
92 f = std::round(
f*dcml)/dcml;
97void Foam::electrostaticDepositionFvPatchScalarField::writeFilmFields()
const
104 const fvMesh&
mesh = eV.mesh();
123 if (isA<electrostaticDepositionFvPatchScalarField>(bf[patchi]))
125 electrostaticDepositionFvPatchScalarField& eVpf = eVPatch(patchi);
139Foam::electrostaticDepositionFvPatchScalarField::
140electrostaticDepositionFvPatchScalarField
146 fixedValueFvPatchScalarField(
p, iF),
167Foam::electrostaticDepositionFvPatchScalarField::
168electrostaticDepositionFvPatchScalarField
175 fixedValueFvPatchScalarField(
p, iF,
dict, false),
176 h_(
"h",
dict,
p.size()),
197 Vi_(
dict.getOrDefault<scalar>(
"Vi", 0)),
198 Vanode_(
dict.getOrDefault<scalar>(
"Vanode", GREAT)),
199 phasesDict_(
dict.subOrEmptyDict(
"phases")),
208 dict.getCheckOrDefault<scalar>
232 if (!phasesDict_.empty())
234 phaseNames_.
setSize(phasesDict_.size());
235 phases_.setSize(phasesDict_.size());
236 sigmas_.setSize(phasesDict_.size());
239 for (
const entry& dEntry : phasesDict_)
241 const word& key = dEntry.keyword();
243 if (!dEntry.isDict())
246 <<
"Entry " << key <<
" is not a dictionary" <<
nl
252 phaseNames_[
phasei] = key;
276 db().getObjectPtr<volScalarField>(phaseNames_[i])
283Foam::electrostaticDepositionFvPatchScalarField::
284electrostaticDepositionFvPatchScalarField
292 fixedValueFvPatchScalarField(ptf,
p, iF, mapper),
294 qcum_(ptf.qcum_, mapper),
295 Vfilm_(ptf.Vfilm_, mapper),
296 Ceffptr_(ptf.Ceffptr_.clone(
p.patch())),
297 rptr_(ptf.rptr_.clone(
p.patch())),
302 Vanode_(ptf.Vanode_),
303 phasesDict_(ptf.phasesDict_),
304 phaseNames_(ptf.phaseNames_),
305 phases_(ptf.phases_),
313Foam::electrostaticDepositionFvPatchScalarField::
314electrostaticDepositionFvPatchScalarField
319 fixedValueFvPatchScalarField(ptf),
323 Ceffptr_(ptf.Ceffptr_.clone(patch().patch())),
324 rptr_(ptf.rptr_.clone(patch().patch())),
329 Vanode_(ptf.Vanode_),
330 phasesDict_(ptf.phasesDict_),
331 phaseNames_(ptf.phaseNames_),
332 phases_(ptf.phases_),
340Foam::electrostaticDepositionFvPatchScalarField::
341electrostaticDepositionFvPatchScalarField
347 fixedValueFvPatchScalarField(ptf, iF),
351 Ceffptr_(ptf.Ceffptr_.clone(patch().patch())),
352 rptr_(ptf.rptr_.clone(patch().patch())),
357 Vanode_(ptf.Vanode_),
358 phasesDict_(ptf.phasesDict_),
359 phaseNames_(ptf.phaseNames_),
360 phases_(ptf.phases_),
375 fixedValueFvPatchScalarField::autoMap(m);
383 Ceffptr_->autoMap(m);
399 fixedValueFvPatchScalarField::rmap(ptf, addr);
402 refCast<const electrostaticDepositionFvPatchScalarField>(ptf);
404 h_.rmap(tiptf.h_, addr);
405 qcum_.rmap(tiptf.qcum_, addr);
406 Vfilm_.rmap(tiptf.Vfilm_, addr);
410 Ceffptr_->rmap(tiptf.Ceffptr_(), addr);
415 rptr_->rmap(tiptf.rptr_(), addr);
423 const label patchi = patch().index();
428 phases_[0].boundaryField()[patchi]*sigmas_[0].value();
430 for (label i = 1; i < phases_.size(); ++i)
433 phases_[i].boundaryField()[patchi]*sigmas_[i].value();
455 const scalar t = db().time().timeOutputValue();
456 const scalar dt = db().time().deltaTValue();
457 const label patchi = patch().index();
465 jnp =
max(jnp, scalar(0));
477 dh =
max(dh, scalar(0));
485 if (qcum_[i] < qMin_)
500 Vfilm_ =
min(Vfilm_, Vanode_);
511 fixedValueFvPatchScalarField::updateCoeffs();
513 timei_ = db().time().timeIndex();
516 const scalar hMin =
gMin(h_);
517 const scalar hMax =
gMax(h_);
522 Info<<
" patch: " << patch().name()
523 <<
", h: min = " << hMin
524 <<
", max = " << hMax
525 <<
", average = " << hAvg <<
nl
531 if (db().time().writeTime())
536 if (patch().index() == master_)
548 h_.writeEntry(
"h",
os);
552 Ceffptr_->writeData(
os);
557 rptr_->writeData(
os);
560 if (!phasesDict_.empty())
562 phasesDict_.writeEntry(phasesDict_.dictName(),
os);
566 sigma_.writeEntry(
"sigma",
os);
577 writeEntry(
"value",
os);
Macros for easy insertion into run-time selection tables.
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
Type of boundary fields.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
void setSize(const label n)
Alias for resize()
static MinMax< scalar > ge(const scalar &minVal)
A semi-infinite range from minVal to the type max.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getCheck(const word &keyword, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
The electrostaticDeposition is a boundary condition to calculate electric potential (V) on a given bo...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
electrostaticDepositionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
tmp< scalarField > sigma() const
Return the isotropic electrical conductivity field of mixture.
A keyword and a list of tokens is an 'entry'.
virtual bool write()
Write the output fields.
const Time & time() const
Return the top-level database.
A FieldMapper for finite-volume patch fields.
virtual void operator=(const UList< scalar > &)
friend Ostream & operator(Ostream &, const fvPatchField< scalar > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual bool write(const bool valid=true) const
Write using setting from DB.
splitCell * master() const
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimCurrent(0, 0, 0, 0, 0, 1, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Type gAverage(const FieldField< Field, Type > &f)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Type gMin(const FieldField< Field, Type > &f)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gMax(const FieldField< Field, Type > &f)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.