Hello,
I am running preCICE 3.1.1 and OpenFOAM v2312 and am working on implementing a custom adapter.
I have a question regarding the implementation of the Forces module. In Forces.C we check whether some other part of OpenFOAM (forces functionObject, solids4Foam) has already calculated the forces, correct?
// Check if a force field with the requested name exists.
// If yes (e.g., solids4Foam), bind Force_ to that field.
// If not (e.g., pimpleFoam without the Forces function object), create it.
if (mesh_.foundObject<volVectorField>(nameForce))
{
Force_ =
&const_cast<volVectorField&>(
mesh_.lookupObject<volVectorField>(nameForce));
}
nameForce
defaults to Force
according to FSI.C
nameForce_ = FSIdict.lookupOrDefault<word>("nameForce", "Force");
DEBUG(adapterInfo(" force field name : " + nameForce_));
However, in forces.C (from functionObject) the name of the forces volVectorField is force
forcePtr = new volVectorField
(
IOobject
(
scopedName("force"),
time_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh_,
dimensionedVector(dimForce, Zero)
);
So it seems to me, like we want to benefit from taking the pre-calculated forces from those sources, but we don’t due to the wrong nameForce
.
Am I missing something?
Thanks
David