25 const word objFuncName,
26 const word objFuncPart,
27 const dictionary& objFuncDict)
43 if (
mesh_.thisDb().foundObject<volScalarField>(
"p_rgh"))
56 const IOdictionary& thermoDict =
mesh_.thisDb().lookupObject<IOdictionary>(
"thermophysicalProperties");
57 dictionary mixSubDict = thermoDict.subDict(
"mixture");
58 dictionary thermodynamicsSubDict = mixSubDict.subDict(
"thermodynamics");
59 Cp_ = thermodynamicsSubDict.getScalar(
"Cp");
60 gamma_ = thermodynamicsSubDict.getScalar(
"gamma");
64 Info <<
"Cp " <<
Cp_ << endl;
65 Info <<
"gamma " <<
gamma_ << endl;
71 const labelList& objFuncFaceSources,
72 const labelList& objFuncCellSources,
73 scalarList& objFuncFaceValues,
74 scalarList& objFuncCellValues,
105 forAll(objFuncFaceSources, idxI)
107 const label& objFuncFaceI = objFuncFaceSources[idxI];
111 word patchName =
mesh_.boundaryMesh()[patchI].name();
122 FatalErrorIn(
" ") <<
"inlet/outletPatches names are not in patches" << abort(FatalError);
130 forAll(objFuncFaceValues, idxI)
132 objFuncFaceValues[idxI] = 0.0;
137 const objectRegistry& db =
mesh_.thisDb();
138 const volScalarField&
p = db.lookupObject<volScalarField>(
"p");
139 const volScalarField&
T = db.lookupObject<volScalarField>(
"T");
140 const volVectorField&
U = db.lookupObject<volVectorField>(
"U");
145 const volScalarField::Boundary& pBf =
p.boundaryField();
146 const volScalarField::Boundary& TBf =
T.boundaryField();
147 const volVectorField::Boundary& UBf =
U.boundaryField();
153 forAll(objFuncFaceSources, idxI)
155 const label& objFuncFaceI = objFuncFaceSources[idxI];
160 scalar pS = pBf[patchI][faceI];
161 scalar TS = TBf[patchI][faceI];
162 scalar UMag = mag(UBf[patchI][faceI]);
163 scalar SfX =
mesh_.magSf().boundaryField()[patchI][faceI];
164 scalar Ma2 = sqr(UMag / sqrt(
gamma_ * R * TS));
165 scalar pT = pS * pow(1.0 + 0.5 * (
gamma_ - 1.0) * Ma2, expCoeff);
167 word patchName =
mesh_.boundaryMesh()[patchI].name();
178 FatalErrorIn(
" ") <<
"inlet/outletPatches names are not in patches" << abort(FatalError);
181 reduce(TPIn, sumOp<scalar>());
182 reduce(TPOut, sumOp<scalar>());
191 objFuncValue = TPOut / TPIn;
194 forAll(objFuncFaceSources, idxI)
196 const label& objFuncFaceI = objFuncFaceSources[idxI];
201 scalar pS = pBf[patchI][faceI];
202 scalar TS = TBf[patchI][faceI];
203 scalar UMag = mag(UBf[patchI][faceI]);
204 scalar SfX =
mesh_.magSf().boundaryField()[patchI][faceI];
205 scalar Ma2 = sqr(UMag / sqrt(
gamma_ * R * TS));
206 scalar pT = pS * pow(1.0 + 0.5 * (
gamma_ - 1.0) * Ma2, expCoeff);
208 word patchName =
mesh_.boundaryMesh()[patchI].name();
219 FatalErrorIn(
" ") <<
"inlet/outletPatches names are not in patches" << abort(FatalError);