24 const word functionName)
37 const IOdictionary& thermoDict =
mesh_.thisDb().lookupObject<IOdictionary>(
"thermophysicalProperties");
38 dictionary mixSubDict = thermoDict.subDict(
"mixture");
39 dictionary thermodynamicsSubDict = mixSubDict.subDict(
"thermodynamics");
40 Cp_ = thermodynamicsSubDict.getScalar(
"Cp");
41 gamma_ = thermodynamicsSubDict.getScalar(
"gamma");
45 Info <<
"Cp " <<
Cp_ << endl;
46 Info <<
"gamma " <<
gamma_ << endl;
67 word patchName =
mesh_.boundaryMesh()[patchI].name();
78 FatalErrorIn(
" ") <<
"inlet/outletPatches names are not in patches" << abort(FatalError);
85 scalar functionValue = 0.0;
87 const objectRegistry& db =
mesh_.thisDb();
88 const volScalarField&
T = db.lookupObject<volScalarField>(
"T");
89 const volVectorField&
U = db.lookupObject<volVectorField>(
"U");
93 const volScalarField::Boundary& TBf =
T.boundaryField();
94 const volVectorField::Boundary& UBf =
U.boundaryField();
107 scalar TS = TBf[patchI][faceI];
108 scalar UMag = mag(UBf[patchI][faceI]);
109 scalar SfX =
mesh_.magSf().boundaryField()[patchI][faceI];
110 scalar Ma2 = sqr(UMag / sqrt(
gamma_ * R * TS));
111 scalar TT = TS * (1.0 + 0.5 * (
gamma_ - 1.0) * Ma2);
113 word patchName =
mesh_.boundaryMesh()[patchI].name();
124 FatalErrorIn(
" ") <<
"inlet/outletPatches names are not in patches" << abort(FatalError);
127 reduce(TTIn, sumOp<scalar>());
128 reduce(TTOut, sumOp<scalar>());
130 functionValue = TTOut / TTIn;
135 return functionValue;