25 const word objFuncName,
26 const word objFuncPart,
27 const dictionary& objFuncDict)
38 rho_(daTurb_.getRho())
45 #ifdef CompressibleFlow
48 {
"U",
"T",
"p",
"phi"},
49 {
"U",
"T",
"p",
"phi"}};
51 #ifdef IncompressibleFlow
63 const labelList& objFuncFaceSources,
64 const labelList& objFuncCellSources,
65 scalarList& objFuncFaceValues,
66 scalarList& objFuncCellValues,
92 forAll(objFuncFaceSources, idxI)
94 const label& objFuncFaceI = objFuncFaceSources[idxI];
104 forAll(objFuncFaceValues, idxI)
106 objFuncFaceValues[idxI] = 0.0;
111 const objectRegistry& db =
mesh_.thisDb();
112 const volScalarField&
p = db.lookupObject<volScalarField>(
"p");
113 const volVectorField&
U = db.lookupObject<volVectorField>(
"U");
115 const volScalarField::Boundary& pBf =
p.boundaryField();
116 const volVectorField::Boundary& UBf =
U.boundaryField();
117 const volScalarField::Boundary& rhoBf =
rho_.boundaryField();
120 forAll(objFuncFaceSources, idxI)
122 const label& objFuncFaceI = objFuncFaceSources[idxI];
127 scalar area =
mesh_.magSf().boundaryField()[patchI][faceI];
128 objFuncFaceValues[idxI] =
129 pBf[patchI][faceI] + 0.5 * rhoBf[patchI][faceI] * mag(UBf[patchI][faceI]) * mag(UBf[patchI][faceI]);
132 objFuncValue += objFuncFaceValues[idxI];
136 reduce(objFuncValue, sumOp<scalar>());