100int main(
int argc,
char *argv[])
104 "Potential flow solver which solves for the velocity potential"
111 "Name of the pressure field"
114 argList::addBoolOption
117 "Initialise U boundary conditions"
120 argList::addBoolOption
123 "Write the final volumetric flux field"
126 argList::addBoolOption
129 "Write the final velocity potential field"
132 argList::addBoolOption
135 "Calculate and write the Euler pressure field"
138 argList::addBoolOption
140 "withFunctionObjects",
141 "Execute functionObjects"
145 regionModels::allowFaModels(
false);
159 Info<<
nl <<
"Calculating potential flow" <<
endl;
163 runTime.functionObjects().start();
178 PhiEqn.setReference(PhiRefCell, PhiRefValue);
183 phi -= PhiEqn.flux();
189 Info<<
"Continuity error = "
193 U = fvc::reconstruct(
phi);
194 U.correctBoundaryConditions();
196 Info<<
"Interpolated velocity error = "
204 if (
args.found(
"writephi"))
210 if (
args.found(
"writePhi"))
216 if (
args.found(
"writep"))
218 Info<<
nl <<
"Calculating approximate pressure field" <<
endl;
242 F & fvc::div(
phi,
U),
252 fvm::laplacian(
p) + divDivUU
262 runTime.functionObjects().end();
264 runTime.printExecutionTime(Info);
const dictionary & potentialFlow(mesh.solutionDict().subDict("potentialFlow"))
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.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
fvMatrix< scalar > fvScalarMatrix
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
Type weightedAverage(const UList< scalar > &weights, const UList< Type > &fld)
The local weighted average of a field, using the mag() of the weights.
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< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)
setRefCell(p, pimple.dict(), pRefCell, pRefValue)