This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/solidMechanics/deprecatedSolvers/icoFsiFoam/readCouplingProperties.H
Henrik Rusche 67ab0b5abd Vanilla backport
- in FOAM library
updated containers
backported PackedBoolList, hashedWordList, nullObject, wordRe,
backported functions to
backported int32 support
backported tableReaders
backported Function1, TimeFunction1
backported dynamicCode (for codedBCs, ...) -- needs to be mapped out
advanced error macros (FatalIOErrorInFunction, ...) -- needs to be mapped out
backported IOobject::MUST_READ_IF_MODIFIED and added IOobject::READ_IF_PRESENT_IF_MODIFIED (only in FO)

- in postProcessing
backported IO FOs (partialWrite, removeRegisteredObject, writeDictionary, writeRegisteredObject)
backported field FOs (fieldCoordinateSystemTransform, fieldValues, nearWallFields, processorField, readFields, regionSizeDistribution, streamLine, wallBoundedStreamLine)
backported fvTools FOs (calcFvcDiv, calcFvcGrad, calcMag)
backported jobControl FOs (abortCalculation)
backported utilities FOs (ourantNo, Lambda2, Peclet, Q, codedFunctionObject, pressureTools, residuals, scalarTransport, setTimeStep, timeActivatedFileUpdate, turbulenceFields, vorticity, wallShearStress)
2018-02-16 15:07:55 +01:00

85 lines
2.1 KiB
C++

Info << "Reading coupling properties" << endl;
IOdictionary couplingProperties
(
IOobject
(
"couplingProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
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())
);