db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
85 lines
2.1 KiB
C
85 lines
2.1 KiB
C
Info << "Reading coupling properties" << endl;
|
|
IOdictionary couplingProperties
|
|
(
|
|
IOobject
|
|
(
|
|
"couplingProperties",
|
|
runTime.constant(),
|
|
mesh,
|
|
IOobject::MUST_READ,
|
|
IOobject::NO_WRITE
|
|
)
|
|
);
|
|
|
|
// Read solid patch data
|
|
word solidPatchName(couplingProperties.lookup("solidPatch"));
|
|
|
|
label solidPatchID =
|
|
stressMesh.boundaryMesh().findPatchID(solidPatchName);
|
|
|
|
|
|
// Read fluid patch data
|
|
word fluidPatchName(couplingProperties.lookup("fluidPatch"));
|
|
|
|
label fluidPatchID =
|
|
mesh.boundaryMesh().findPatchID(fluidPatchName);
|
|
|
|
|
|
if (solidPatchID < 0 || fluidPatchID < 0)
|
|
{
|
|
FatalErrorIn(args.executable())
|
|
<< "Problem with patch interpolation definition"
|
|
<< abort(FatalError);
|
|
}
|
|
|
|
|
|
// Create interpolators
|
|
patchToPatchInterpolation interpolatorFluidSolid
|
|
(
|
|
mesh.boundaryMesh()[fluidPatchID],
|
|
stressMesh.boundaryMesh()[solidPatchID]
|
|
);
|
|
|
|
patchToPatchInterpolation interpolatorSolidFluid
|
|
(
|
|
stressMesh.boundaryMesh()[solidPatchID],
|
|
mesh.boundaryMesh()[fluidPatchID]
|
|
);
|
|
|
|
|
|
// Grab solid patch field
|
|
tractionDisplacementFvPatchVectorField& tForce =
|
|
refCast<tractionDisplacementFvPatchVectorField>
|
|
(
|
|
Usolid.boundaryField()[solidPatchID]
|
|
);
|
|
|
|
|
|
// Grab motion field
|
|
|
|
// Read fluid patch data
|
|
word movingRegionName(couplingProperties.lookup("movingRegion"));
|
|
|
|
const fvMesh& motionMesh =
|
|
runTime.objectRegistry::lookupObject<fvMesh>(movingRegionName);
|
|
|
|
tetPointVectorField& motionU =
|
|
const_cast<tetPointVectorField&>
|
|
(
|
|
motionMesh.objectRegistry::lookupObject<tetPointVectorField>
|
|
(
|
|
"motionU"
|
|
)
|
|
);
|
|
|
|
|
|
fixedValueTetPolyPatchVectorField& motionUFluidPatch =
|
|
refCast<fixedValueTetPolyPatchVectorField>
|
|
(
|
|
motionU.boundaryField()[fluidPatchID]
|
|
);
|
|
|
|
tetPolyPatchInterpolation tppi
|
|
(
|
|
refCast<const faceTetPolyPatch>(motionUFluidPatch.patch())
|
|
);
|