potentialFoam
is a potential flow solver which solves for the velocity potential (i.e. Phi
) to calculate the volumetric face-flux field (i.e. phi
) from which the velocity field (i.e. U
) is obtained by reconstructing the flux.potentialFoam
covers flow types with the following characteristics:potentialFoam
can be used for the following applications:potentialFoam
's scope.Operand | Description | Required | Type | Location |
---|---|---|---|---|
U | Velocity [m/s] | mandatory | volVectorField | $FOAM_CASE/<time>/U |
p | Kinematic pressure [m2/s2] | optional | volScalarField | $FOAM_CASE/<time>/p |
Phi | Velocity potential [m2/s] | optional | volScalarField | $FOAM_CASE/<time>/Phi |
Operand | Description | Note | Type | Location |
---|---|---|---|---|
U | Velocity [m/s] | overwrites U | volVectorField | $FOAM_CASE/<time>/U |
p | Kinematic pressure [m2/s2] | overwrites p if -writep exists | volScalarField | $FOAM_CASE/<time>/p |
Phi | Velocity potential [m2/s] | overwrites Phi if -writePhi exists | volScalarField | $FOAM_CASE/<time>/Phi |
phi | Volumetric face flux [m3/s] | writes phi if -writephi exists | surfaceScalarField | $FOAM_CASE/<time>/phi |
$FOAM_CASE/system/fvSchemes requirements:
grad(Phi)
grad(p)
if -writep
is ondiv(phi,U)
div(div(phi,U))
laplacian(1,Phi)
laplacian(p)
if -writep
is on$FOAM_CASE/system/fvSolution requirements:
Phi
p
if -writep
is on.potentialFlow { nNonOrthogonalCorrectors 3; }
-pName <pFieldName>
: Use the field named <pFieldName>
as the input pressure field-writePhi
: Write the velocity potential field-writephi
: Write the volumetric face flux field-writep
: Write the estimated Euler pressure field-initialiseUBCs
: Initialise the velocity boundary conditions prior to computing the volumetric fluxFor incompressible steady-state potential flows, the governing equation of the velocity potential satisfies the Laplace's equation:
\[ \laplacian \Phi = 0 \]
where \(\Phi\) is the velocity potential.
Velocity field (i.e. \( \u \)) can then be computed from the velocity potential as follows:
\[ \u = \grad \Phi \]
where the velocity field is solenoidal:
\[ \div \u = 0 \]
The main differences between the original and implemented governing equations are as follows:
potentialFoam
instead of the Laplace's equation.The implementation of the velocity potential governing equation:
\[ \laplacian \Phi = \div \phi \]
where
\( \Phi \) | = | Velocity potential [m2/s] |
\( \phi \) | = | Volumetric face flux [m3/s] |
\( \phi \) is computed by:
\[ \phi = \u_f \dprod \vec{S}_f \]
where
\( \u_f \) | = | Face-centre velocity field [m/s] |
\( \vec{S}_f \) | = | Surface-normal area vector field [m2] |
\( \dprod \) | = | Inner product |
Finally the cell-centre velocity (i.e. \( \u \)) is derived by reconstructing the volumetric face flux.
In addition to the computation of \( \u \) and \( \phi \), at the end of the potentialFoam
execution, two error metrics and optionally the Euler pressure field are computed.
The first error metric is the continuity error which is computed as the cell-volume weighted average of the divergence of the volumetric face flux field:
\[ \epsilon_c = \frac{ \sum_i V_i |\div \phi |_i }{ \sum_i V_i } \]
where
\( \epsilon_c \) | = | Continuity error |
\( i \) | = | Cell index |
\( V_i \) | = | Volume of the cell i [m3] |
\( \phi \) | = | Volumetric face flux [m3/s] |
The second error metric is the interpolated velocity error which is computed as the normalised difference between the original volumetric face flux (i.e. \( \phi \)), and the volumetric face flux computed from the cell-centre velocity field (which is derived from the original \( \phi \)):
\[ \epsilon_i = \frac{ \sqrt{ \sum (\phi_\u - \phi)_i^2} }{ \sum |\vec{S}_f|_i } \]
where
\( \epsilon_i \) | = | Interpolated velocity error |
\( i \) | = | Cell index |
\( \phi_\u \) | = | Volumetric face flux obtained from velocity [m3/s] |
\( \phi \) | = | Original volumetric face flux [m3/s] |
\( \vec{S}_f \) | = | Surface-normal area vector [m2] |
Optionally, the corresponding pressure field can be estimated from the divergence of the Euler equation:
\[ \laplacian p + \div(\div(\u \otimes \u )) = 0 \]
where \( \otimes \) is the dyadic operator (i.e. outer product).
However, the expression above generates excessive pressure variation in regions of large velocity gradient normal to the flow direction. A better option is to calculate the pressure field corresponding to velocity variation along the streamlines:
\[ \laplacian p + \vec{F}_p = 0 \]
where
\[ \vec{F}_p = \div(\vec{F} \dprod \div(\phi \u)) \]
with the symmetric flow-direction filter tensor (i.e. \( \vec{F} \)) is obtained from:
\[ \vec{F} = \frac{ \u \otimes \u }{ |\u^2| + \zeta \hat{|\u^2|} } \]
where
\( \hat{.} \) | = | Arithmetic average operator |
\( \zeta \) | = | Small value to prevent floating point exceptions |
\( \u \) | = | Velocity field [m/s] |
Tutorial:
Source code:
See also:
History