99int main(
int argc,
char *argv[])
103 "Potential flow solver which solves for the velocity potential"
110 "Name of the pressure field"
113 argList::addBoolOption
116 "Initialise U boundary conditions"
119 argList::addBoolOption
122 "Write the final volumetric flux field"
125 argList::addBoolOption
128 "Write the final velocity potential field"
131 argList::addBoolOption
134 "Calculate and write the Euler pressure field"
137 argList::addBoolOption
139 "withFunctionObjects",
140 "Execute functionObjects"
151 #include "createFields.H"
155 Info<<
nl <<
"Calculating potential flow" <<
endl;
159 runTime.functionObjects().start();
174 PhiEqn.setReference(PhiRefCell, PhiRefValue);
179 phi -= PhiEqn.flux();
185 Info<<
"Continuity error = "
186 <<
mag(fvc::div(
phi))().weightedAverage(
mesh.V()).value()
189 U = fvc::reconstruct(
phi);
190 U.correctBoundaryConditions();
192 Info<<
"Interpolated velocity error = "
214 Info<<
nl <<
"Calculating approximate pressure field" <<
endl;
238 F & fvc::div(
phi,
U),
248 fvm::laplacian(
p) + divDivUU
258 runTime.functionObjects().end();
260 runTime.printExecutionTime(Info);
bool found(const word &optName) const
Return true if the named option is found.
adjustPhi(phiHbyA, U, p_rgh)
volVectorField F(fluid.F())
tmp< GeometricField< Type, faPatchField, areaMesh > > average(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Area-weighted average a edgeField creating a areaField.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
fvMatrix< scalar > fvScalarMatrix
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)
const dictionary & potentialFlow(mesh.solutionDict().subDict("potentialFlow"))
setRefCell(p, pimple.dict(), pRefCell, pRefValue)