DAFoam
v3.0.6
Discrete Adjoint with OpenFOAM
dafoam
src
adjoint
DASolver
DAPisoFoam
pEqnPiso.H
Go to the documentation of this file.
1
volScalarField
rAU
(1.0 /
UEqn
.A());
2
volVectorField
HbyA
(constrainHbyA(
rAU
*
UEqn
.H(),
U
,
p
));
3
surfaceScalarField
phiHbyA
(
4
"phiHbyA"
,
5
fvc::flux(
HbyA
)
6
+ fvc::interpolate(
rAU
) * fvc::ddtCorr(
U
,
phi
));
7
8
adjustPhi
(
phiHbyA
,
U
,
p
);
9
10
// Non-orthogonal pressure corrector loop
11
while
(
piso
.correctNonOrthogonal())
12
{
13
// Pressure corrector
14
15
fvScalarMatrix pEqn(
16
fvm::laplacian(
rAU
,
p
) == fvc::div(
phiHbyA
));
17
18
pEqn.setReference(
pRefCell
,
pRefValue
);
19
20
// get the solver performance info such as initial
21
// and final residuals
22
SolverPerformance<scalar> solverP = pEqn.solve(
mesh
.solver(
p
.select(
piso
.finalInnerIter())));
23
24
this->
primalResidualControl<scalar>
(solverP, printToScreen, printInterval,
"p"
);
25
26
if
(
piso
.finalNonOrthogonalIter())
27
{
28
phi
=
phiHbyA
- pEqn.flux();
29
}
30
}
31
32
if
(printToScreen)
33
{
34
#include "
continuityErrsPython.H
"
35
}
36
37
U
=
HbyA
-
rAU
* fvc::grad(
p
);
38
U
.correctBoundaryConditions();
phiHbyA
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA)+fvc::interpolate(rAU) *fvc::ddtCorr(U, phi))
adjustPhi
adjustPhi(phiHbyA, U, p)
pRefValue
scalar & pRefValue
Definition:
createRefsPimple.H:12
UEqn
fvVectorMatrix & UEqn
Definition:
UEqnPimpleDyM.H:13
pRefCell
label & pRefCell
Definition:
createRefsPimple.H:11
piso
pisoControl & piso
Definition:
createRefsPiso.H:5
p
volScalarField & p
Definition:
createRefsPimple.H:6
continuityErrsPython.H
mesh
fvMesh & mesh
Definition:
createRefsHeatTransfer.H:4
U
U
Definition:
pEqnPiso.H:37
primalResidualControl< scalar >
this primalResidualControl< scalar >(solverE, printToScreen, printInterval, "he")
phi
surfaceScalarField & phi
Definition:
createRefsPimple.H:8
rAU
volScalarField rAU(1.0/UEqn.A())
HbyA
volVectorField HbyA(constrainHbyA(rAU *UEqn.H(), U, p))
Generated by
1.8.17