24 const word functionName)
36 const IOdictionary& thermoDict =
mesh_.thisDb().lookupObject<IOdictionary>(
"thermophysicalProperties");
37 dictionary mixSubDict = thermoDict.subDict(
"mixture");
38 dictionary thermodynamicsSubDict = mixSubDict.subDict(
"thermodynamics");
39 Cp_ = thermodynamicsSubDict.getScalar(
"Cp");
40 gamma_ = thermodynamicsSubDict.getScalar(
"gamma");
44 Info <<
"Cp " <<
Cp_ << endl;
45 Info <<
"gamma " <<
gamma_ << endl;
66 word patchName =
mesh_.boundaryMesh()[patchI].name();
77 FatalErrorIn(
" ") <<
"inlet/outletPatches names are not in patches" << abort(FatalError);
84 scalar functionValue = 0.0;
86 const objectRegistry& db =
mesh_.thisDb();
87 const volScalarField&
p = db.lookupObject<volScalarField>(
"p");
88 const volScalarField&
T = db.lookupObject<volScalarField>(
"T");
89 const volVectorField&
U = db.lookupObject<volVectorField>(
"U");
94 const volScalarField::Boundary& pBf =
p.boundaryField();
95 const volScalarField::Boundary& TBf =
T.boundaryField();
96 const volVectorField::Boundary& UBf =
U.boundaryField();
109 scalar pS = pBf[patchI][faceI];
110 scalar TS = TBf[patchI][faceI];
111 scalar UMag = mag(UBf[patchI][faceI]);
112 scalar SfX =
mesh_.magSf().boundaryField()[patchI][faceI];
113 scalar Ma2 = sqr(UMag / sqrt(
gamma_ * R * TS));
114 scalar pT = pS * pow(1.0 + 0.5 * (
gamma_ - 1.0) * Ma2, expCoeff);
116 word patchName =
mesh_.boundaryMesh()[patchI].name();
127 FatalErrorIn(
" ") <<
"inlet/outletPatches names are not in patches" << abort(FatalError);
130 reduce(TPIn, sumOp<scalar>());
131 reduce(TPOut, sumOp<scalar>());
133 functionValue = TPOut / TPIn;
138 return functionValue;