17 #include "simpleControl.H"
18 #include "fvOptions.H"
19 #include "singlePhaseTransportModel.H"
20 #include "turbulentTransportModel.H"
28 Info <<
"Computing liftPerS...." << endl;
33 "List of patch names to compute");
43 "Tme instance to compute");
45 #include "setRootCase.H"
46 #include "createTime.H"
49 if (
args.optionFound(
"time"))
51 time = readScalar(
args.optionLookup(
"time")());
55 Info <<
"time not set! Exit." << endl;
60 #include "createMesh.H"
63 List<wordRe> patchNames;
64 if (
args.optionFound(
"patchNames"))
66 patchNames = wordReList(
args.optionLookup(
"patchNames")());
70 Info <<
"patchNames not set! Exit." << endl;
74 List<scalar> liftDir1;
75 if (
args.optionFound(
"liftDir"))
77 liftDir1 = scalarList(
args.optionLookup(
"liftDir")());
81 Info <<
"liftDir not set! Exit." << endl;
84 vector liftDir(vector::zero);
85 liftDir.x() = liftDir1[0];
86 liftDir.y() = liftDir1[1];
87 liftDir.z() = liftDir1[2];
89 volScalarField liftPerS(
97 dimensionedScalar(
"liftPerS", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0),
98 fixedValueFvPatchScalarField::typeName);
103 vector forces(vector::zero);
105 const surfaceVectorField::Boundary& Sfb =
mesh.Sf().boundaryField();
106 const surfaceScalarField::Boundary& magSfb =
mesh.magSf().boundaryField();
108 tmp<volSymmTensorField> tdevRhoReff =
turbulence->devRhoReff();
109 const volSymmTensorField::Boundary& devRhoReffb = tdevRhoReff().boundaryField();
114 label patchI =
mesh.boundaryMesh().findPatchID(patchNames[cI]);
116 const fvPatch& patch =
mesh.boundary()[patchI];
119 Sfb[patchI] *
p.boundaryField()[patchI]);
121 vectorField fT(Sfb[patchI] & devRhoReffb[patchI]);
125 forces.x() = fN[faceI].x() + fT[faceI].x();
126 forces.y() = fN[faceI].y() + fT[faceI].y();
127 forces.z() = fN[faceI].z() + fT[faceI].z();
128 scalar lift = forces & liftDir;
129 liftPerS.boundaryFieldRef()[patchI][faceI] = lift / magSfb[patchI][faceI];
134 Info <<
"Force: " << forces << endl;
136 Info <<
"Computing liftPerS.... Completed!" << endl;