Go to the documentation of this file.
62 GeometricField<Type, fvPatchField, volMesh>& vf,
75 int main(
int argc,
char *argv[])
79 "Steady-state solver for incompressible, turbulent flow"
80 " of non-Newtonian fluids with duct shape optimisation"
81 " by applying 'blockage' in regions causing pressure loss"
90 #include "createControl.H"
91 #include "createFields.H"
92 #include "initContinuityErrs.H"
99 Info<<
"\nStarting time loop\n" <<
endl;
109 mesh.fieldRelaxationFactor(
"alpha")
119 tmp<fvVectorMatrix>
tUEqn
147 while (
simple.correctNonOrthogonal())
157 if (
simple.finalNonOrthogonalIter())
163 #include "continuityErrs.H"
170 U.correctBoundaryConditions();
189 tmp<fvVectorMatrix> tUaEqn
192 - adjointTransposeConvection
210 HbyAa = rAUa*UaEqn.H();
216 while (
simple.correctNonOrthogonal())
223 paEqn.setReference(paRefCell, paRefValue);
226 if (
simple.finalNonOrthogonalIter())
228 phia = phiHbyAa -
paEqn.flux();
239 Ua.correctBoundaryConditions();
void constrainPressure(volScalarField &p, const RhoType &rho, const volVectorField &U, const surfaceScalarField &phiHbyA, const RAUType &rhorAU, const MRFType &MRF)
List< label > labelList
A List of labels.
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
bool adjustPhi(surfaceScalarField &phi, const volVectorField &U, volScalarField &p)
const dictionary & simple
tmp< volScalarField > rAU
Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
static constexpr const zero Zero
const dimensionedScalar alpha
const labelList & inletCells
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Ostream & endl(Ostream &os)
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
label min(const labelHashSet &set, label minValue=labelMax)
zeroCells(alpha, inletCells)
Declare and initialise the cumulative ddjoint continuity error.
fvMatrix< vector > fvVectorMatrix
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
fvMatrix< scalar > fvScalarMatrix
GeometricField< scalar, fvPatchField, volMesh > volScalarField
label max(const labelHashSet &set, label maxValue=labelMin)
dimensionedScalar alphaMax("alphaMax", dimless/dimTime, laminarTransport)
fvScalarMatrix paEqn(fvm::d2dt2(pa) - sqr(c0) *fvc::laplacian(pa))
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
Execute application functionObjects to post-process existing results.
dimensionedScalar zeroAlpha(dimless/dimTime, Zero)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Calculates and prints the continuity errors.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
tmp< surfaceScalarField > flux(const volVectorField &vvf)
singlePhaseTransportModel laminarTransport(U, phi)