62 GeometricField<Type, fvPatchField, volMesh>& vf,
63 const labelUList&
cells
66 UIndirectList<Type>(vf.primitiveField(),
cells) = Zero;
72int main(
int argc,
char *argv[])
76 "Steady-state solver for incompressible, turbulent flow"
77 " of non-Newtonian fluids with duct shape optimisation"
78 " by applying 'blockage' in regions causing pressure loss"
87 #include "createControl.H"
89 #include "initContinuityErrs.H"
96 Info<<
"\nStarting time loop\n" <<
endl;
106 mesh.fieldRelaxationFactor(
"alpha")
116 tmp<fvVectorMatrix>
tUEqn
144 while (
simple.correctNonOrthogonal())
154 if (
simple.finalNonOrthogonalIter())
160 #include "continuityErrs.H"
167 U.correctBoundaryConditions();
186 tmp<fvVectorMatrix> tUaEqn
189 - adjointTransposeConvection
201 solve(UaEqn == -fvc::grad(pa));
207 HbyAa = rAUa*UaEqn.H();
213 while (
simple.correctNonOrthogonal())
217 fvm::laplacian(rAUa, pa) == fvc::div(phiHbyAa)
220 paEqn.setReference(paRefCell, paRefValue);
223 if (
simple.finalNonOrthogonalIter())
225 phia = phiHbyAa -
paEqn.flux();
235 Ua = HbyAa - rAUa*fvc::grad(pa);
236 Ua.correctBoundaryConditions();
245 runTime.printExecutionTime(Info);
Calculates and prints the continuity errors.
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
compressible::turbulenceModel & turbulence
adjustPhi(phiHbyA, U, p_rgh)
Declare and initialise the cumulative ddjoint continuity error.
tmp< volScalarField > rAU
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
GeometricField< vector, fvPatchField, volMesh > volVectorField
fvMatrix< scalar > fvScalarMatrix
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Ostream & endl(Ostream &os)
Add newline and flush stream.
fvMatrix< vector > fvVectorMatrix
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a).
fvScalarMatrix paEqn(fvm::d2dt2(pa) - sqr(c0) *fvc::laplacian(pa))
Execute application functionObjects to post-process existing results.
const dictionary & simple
singlePhaseTransportModel laminarTransport(U, phi)
dimensionedScalar zeroAlpha(dimless/dimTime, Zero)
const labelUList & inletCells
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
zeroCells(alpha, inletCells)
dimensionedScalar alphaMax("alphaMax", dimless/dimTime, laminarTransport)