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/icoFsiElasticNonLinULSolidFoam/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

170 lines
4.6 KiB
C++

Info << "\nReading 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)
);
if (solidPatchID < 0)
{
FatalErrorIn(args.executable())
<< "Problem with finding solid patch"
<< abort(FatalError);
}
word solidZoneName(couplingProperties.lookup("solidZone"));
label solidZoneID =
stressMesh.faceZones().findZoneID(solidZoneName);
if (solidZoneID < 0)
{
FatalErrorIn(args.executable())
<< "Problem with finding solid zone"
<< abort(FatalError);
}
// const label solidPatchStart =
// stressMesh.boundaryMesh()[solidPatchID].start();
// const faceZone& solidZone = stressMesh.faceZones()[solidZoneID];
// Read fluid patch data
word fluidPatchName(couplingProperties.lookup("fluidPatch"));
label fluidPatchID =
mesh.boundaryMesh().findPatchID(fluidPatchName);
if (fluidPatchID < 0)
{
FatalErrorIn(args.executable())
<< "Problem with finding fluid patch"
<< abort(FatalError);
}
word fluidZoneName(couplingProperties.lookup("fluidZone"));
label fluidZoneID =
mesh.faceZones().findZoneID(fluidZoneName);
if (fluidZoneID < 0)
{
FatalErrorIn(args.executable())
<< "Problem with finding fluid zone"
<< abort(FatalError);
}
// const label fluidPatchStart =
// mesh.boundaryMesh()[fluidPatchID].start();
// const faceZone& fluidZone = mesh.faceZones()[fluidZoneID];
// Check mesh motion solver type
bool feMotionSolver =
mesh.objectRegistry::foundObject<tetPointVectorField>
(
"motionU"
);
bool fvMotionSolver =
mesh.objectRegistry::foundObject<pointVectorField>
(
"pointMotionU"
);
// Grab solid patch field
if
(
DU.boundaryField()[solidPatchID].type()
!= solidTractionFvPatchVectorField::typeName
//!= tractionDisplacementIncrementFvPatchVectorField::typeName
)
{
FatalErrorIn(args.executable())
<< "Bounary condition on " << DU.name()
<< " is "
<< DU.boundaryField()[solidPatchID].type()
<< "for fluid -solid interface patch, instead "
<< solidTractionFvPatchVectorField::typeName
//<< tractionDisplacementIncrementFvPatchVectorField::typeName
<< abort(FatalError);
}
//tractionDisplacementIncrementFvPatchVectorField& tForce =
// refCast<tractionDisplacementIncrementFvPatchVectorField>
solidTractionFvPatchVectorField& tForce =
refCast<solidTractionFvPatchVectorField>
(
DU.boundaryField()[solidPatchID]
);
// Accumulated fluid interface displacement
IOobject accumulatedFluidInterfaceDisplacementHeader
(
"accumulatedFluidInterfaceDisplacement",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
vectorField* accumulatedFluidInterfaceDisplacementPtr = NULL;
if(accumulatedFluidInterfaceDisplacementHeader.headerOk())
{
Pout << "Reading accumulated fluid interface displacement" << endl;
accumulatedFluidInterfaceDisplacementPtr =
new vectorIOField
(
IOobject
(
"accumulatedFluidInterfaceDisplacement",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
)
);
}
else
{
accumulatedFluidInterfaceDisplacementPtr =
new vectorIOField
(
IOobject
(
"accumulatedFluidInterfaceDisplacement",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
vectorField
(
mesh.boundaryMesh()[fluidPatchID].nPoints(),
vector::zero
)
);
}
vectorField& accumulatedFluidInterfaceDisplacement
= *accumulatedFluidInterfaceDisplacementPtr;