23 const dynamicFvMesh&
mesh,
33 const dynamicFvMesh&
mesh,
39 word modelType =
daOption.getAllOptions().subDict(
"rigidBodyMotion").getWord(
"mode");
41 if (
daOption.getAllOptions().lookupOrDefault<label>(
"debug", 0))
43 Info <<
"Selecting type: " << modelType <<
" for DAMotion. " << endl;
46 dictionaryConstructorTable::iterator cstrIter =
47 dictionaryConstructorTablePtr_->find(modelType);
50 if (cstrIter == dictionaryConstructorTablePtr_->end())
55 " const dynamicFvMesh&,"
58 <<
"Unknown DAMotion type "
59 << modelType << nl << nl
60 <<
"Valid DAMotion types:" << endl
61 << dictionaryConstructorTablePtr_->sortedToc()
66 return autoPtr<DAMotion>(
75 const objectRegistry& db =
mesh.thisDb();
76 const volScalarField&
p = db.lookupObject<volScalarField>(
"p");
77 const volScalarField& nut = db.lookupObject<volScalarField>(
"nut");
78 const volScalarField& nu = db.lookupObject<volScalarField>(
"nu");
79 const volVectorField&
U = db.lookupObject<volVectorField>(
"U");
81 volSymmTensorField tdevRhoReff(
"devRhoReff", -(nu + nut) * dev(twoSymm(fvc::grad(
U))));
83 const volSymmTensorField::Boundary& devRhoReffb = tdevRhoReff.boundaryField();
86 vector force(vector::zero);
92 vectorField fN(
mesh.Sf().boundaryField()[patchI] *
p.boundaryField()[patchI]);
94 vectorField fT(
mesh.Sf().boundaryField()[patchI] & devRhoReffb[patchI]);
98 force += fN[faceI] + fT[faceI];
102 reduce(force[0], sumOp<scalar>());
103 reduce(force[1], sumOp<scalar>());
104 reduce(force[2], sumOp<scalar>());