25 const word objFuncName,
26 const word objFuncPart,
27 const dictionary& objFuncDict)
51 const IOdictionary& thermoDict =
mesh_.thisDb().lookupObject<IOdictionary>(
"thermophysicalProperties");
52 dictionary mixSubDict = thermoDict.subDict(
"mixture");
53 dictionary thermodynamicsSubDict = mixSubDict.subDict(
"thermodynamics");
54 Cp_ = thermodynamicsSubDict.getScalar(
"Cp");
55 gamma_ = thermodynamicsSubDict.getScalar(
"gamma");
59 Info <<
"Cp " <<
Cp_ << endl;
60 Info <<
"gamma " <<
gamma_ << endl;
66 const labelList& objFuncFaceSources,
67 const labelList& objFuncCellSources,
68 scalarList& objFuncFaceValues,
69 scalarList& objFuncCellValues,
100 forAll(objFuncFaceSources, idxI)
102 const label& objFuncFaceI = objFuncFaceSources[idxI];
106 word patchName =
mesh_.boundaryMesh()[patchI].name();
117 FatalErrorIn(
" ") <<
"inlet/outletPatches names are not in patches" << abort(FatalError);
125 forAll(objFuncFaceValues, idxI)
127 objFuncFaceValues[idxI] = 0.0;
132 const objectRegistry& db =
mesh_.thisDb();
133 const volScalarField&
T = db.lookupObject<volScalarField>(
"T");
134 const volVectorField&
U = db.lookupObject<volVectorField>(
"U");
138 const volScalarField::Boundary& TBf =
T.boundaryField();
139 const volVectorField::Boundary& UBf =
U.boundaryField();
145 forAll(objFuncFaceSources, idxI)
147 const label& objFuncFaceI = objFuncFaceSources[idxI];
152 scalar TS = TBf[patchI][faceI];
153 scalar UMag = mag(UBf[patchI][faceI]);
154 scalar SfX =
mesh_.magSf().boundaryField()[patchI][faceI];
155 scalar Ma2 = sqr(UMag / sqrt(
gamma_ * R * TS));
156 scalar TT = TS * (1.0 + 0.5 * (
gamma_ - 1.0) * Ma2);
158 word patchName =
mesh_.boundaryMesh()[patchI].name();
169 FatalErrorIn(
" ") <<
"inlet/outletPatches names are not in patches" << abort(FatalError);
172 reduce(TTIn, sumOp<scalar>());
173 reduce(TTOut, sumOp<scalar>());
182 objFuncValue = TTOut / TTIn;
185 forAll(objFuncFaceSources, idxI)
187 const label& objFuncFaceI = objFuncFaceSources[idxI];
192 scalar TS = TBf[patchI][faceI];
193 scalar UMag = mag(UBf[patchI][faceI]);
194 scalar SfX =
mesh_.magSf().boundaryField()[patchI][faceI];
195 scalar Ma2 = sqr(UMag / sqrt(
gamma_ * R * TS));
196 scalar TT = TS * (1.0 + 0.5 * (
gamma_ - 1.0) * Ma2);
198 word patchName =
mesh_.boundaryMesh()[patchI].name();
209 FatalErrorIn(
" ") <<
"inlet/outletPatches names are not in patches" << abort(FatalError);