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();
fvMatrix< scalar > fvScalarMatrix
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
zeroCells(alpha, inletCells)
const labelList & inletCells
GeometricField< vector, fvPatchField, volMesh > volVectorField
tmp< volScalarField > rAU
bool adjustPhi(surfaceScalarField &phi, const volVectorField &U, volScalarField &p)
Adjust the balance of fluxes to obey continuity.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
singlePhaseTransportModel laminarTransport(U, phi)
dimensionedScalar alphaMax("alphaMax", dimless/dimTime, laminarTransport)
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensionedScalar zeroAlpha(dimless/dimTime, Zero)
Declare and initialise the cumulative ddjoint continuity error.
Info<< "Reading field U\"<< 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\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
void constrainPressure(volScalarField &p, const RhoType &rho, const volVectorField &U, const surfaceScalarField &phiHbyA, const RAUType &rhorAU, const MRFType &MRF)
const dictionary & simple
fvMatrix< vector > fvVectorMatrix
Calculates and prints the continuity errors.
messageStream Info
Information stream (stdout output on master, null elsewhere)
fvScalarMatrix paEqn(fvm::d2dt2(pa) - sqr(c0) *fvc::laplacian(pa))
List< label > labelList
A List of labels.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Execute application functionObjects to post-process existing results.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
static constexpr const zero Zero
Global zero (0)