mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: electricPotential: add finite-volume constraint hook
This commit is contained in:
committed by
Andrew Heather
parent
a50ee8e2d2
commit
f3d939fa10
@ -217,6 +217,7 @@ Foam::functionObjects::electricPotential::electricPotential
|
|||||||
IOobject::scopedName(typeName, "E")
|
IOobject::scopedName(typeName, "E")
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
fvOptions_(mesh_),
|
||||||
nCorr_(1),
|
nCorr_(1),
|
||||||
writeDerivedFields_(false),
|
writeDerivedFields_(false),
|
||||||
electricField_(false)
|
electricField_(false)
|
||||||
@ -341,6 +342,11 @@ bool Foam::functionObjects::electricPotential::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (const dictionary* dictptr = dict.findDict("fvOptions"))
|
||||||
|
{
|
||||||
|
fvOptions_.reset(*dictptr);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,6 +369,8 @@ bool Foam::functionObjects::electricPotential::execute()
|
|||||||
|
|
||||||
eVEqn.relax();
|
eVEqn.relax();
|
||||||
|
|
||||||
|
fvOptions_.constrain(eVEqn);
|
||||||
|
|
||||||
eVEqn.solve();
|
eVEqn.solve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -123,6 +123,7 @@ Usage
|
|||||||
V <word>;
|
V <word>;
|
||||||
electricField <bool>;
|
electricField <bool>;
|
||||||
E <word>;
|
E <word>;
|
||||||
|
fvOptions <dict>;
|
||||||
|
|
||||||
// Inherited entries
|
// Inherited entries
|
||||||
...
|
...
|
||||||
@ -141,10 +142,12 @@ Usage
|
|||||||
V | Name of electric potential field | word | no | electricPotential:V
|
V | Name of electric potential field | word | no | electricPotential:V
|
||||||
electricField | Flag to calculate electric field | bool | no | false
|
electricField | Flag to calculate electric field | bool | no | false
|
||||||
E | Name of electric field | word | no | electricPotential:E
|
E | Name of electric field | word | no | electricPotential:E
|
||||||
|
fvOptions | List of finite-volume options | dict | no | -
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
The inherited entries are elaborated in:
|
The inherited entries are elaborated in:
|
||||||
- \link functionObject.H \endlink
|
- \link functionObject.H \endlink
|
||||||
|
- \link fvOption.H \endlink
|
||||||
|
|
||||||
Fields written out when the \c writeDerivedFields entry is \c true:
|
Fields written out when the \c writeDerivedFields entry is \c true:
|
||||||
\table
|
\table
|
||||||
@ -153,6 +156,9 @@ Usage
|
|||||||
Charge density | volScalarField | \<time\>/electricPotential:rho
|
Charge density | volScalarField | \<time\>/electricPotential:rho
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
|
Note
|
||||||
|
- Only constraint-type finite-volume options can be used.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
electricPotential.C
|
electricPotential.C
|
||||||
|
|
||||||
@ -163,6 +169,7 @@ SourceFiles
|
|||||||
|
|
||||||
#include "fvMeshFunctionObject.H"
|
#include "fvMeshFunctionObject.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "fvOptionList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -208,6 +215,9 @@ class electricPotential
|
|||||||
//- Name of electric field
|
//- Name of electric field
|
||||||
word Ename_;
|
word Ename_;
|
||||||
|
|
||||||
|
//- Run-time selectable finite volume options
|
||||||
|
fv::optionList fvOptions_;
|
||||||
|
|
||||||
//- Number of corrector iterations
|
//- Number of corrector iterations
|
||||||
int nCorr_;
|
int nCorr_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user