2012-09-11 15:42:55 +00:00
|
|
|
Info << "\nReading coupling properties" << endl;
|
|
|
|
IOdictionary couplingProperties
|
|
|
|
(
|
|
|
|
IOobject
|
|
|
|
(
|
|
|
|
"couplingProperties",
|
|
|
|
runTime.constant(),
|
|
|
|
mesh,
|
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)
2017-04-09 13:11:54 +00:00
|
|
|
IOobject::MUST_READ_IF_MODIFIED,
|
2012-09-11 15:42:55 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2014-06-01 18:12:52 +00:00
|
|
|
// const label solidPatchStart =
|
2012-09-11 15:42:55 +00:00
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
|
2014-06-01 18:12:52 +00:00
|
|
|
// const label fluidPatchStart =
|
2012-09-11 15:42:55 +00:00
|
|
|
// mesh.boundaryMesh()[fluidPatchID].start();
|
|
|
|
|
|
|
|
// const faceZone& fluidZone = mesh.faceZones()[fluidZoneID];
|
|
|
|
|
|
|
|
|
2014-06-01 18:12:52 +00:00
|
|
|
// Check mesh motion solver type
|
|
|
|
bool feMotionSolver =
|
2012-09-11 15:42:55 +00:00
|
|
|
mesh.objectRegistry::foundObject<tetPointVectorField>
|
2015-05-17 15:11:30 +00:00
|
|
|
(
|
2012-09-11 15:42:55 +00:00
|
|
|
"motionU"
|
2015-05-17 15:11:30 +00:00
|
|
|
);
|
2012-09-11 15:42:55 +00:00
|
|
|
bool fvMotionSolver =
|
|
|
|
mesh.objectRegistry::foundObject<pointVectorField>
|
2015-05-17 15:11:30 +00:00
|
|
|
(
|
2012-09-11 15:42:55 +00:00
|
|
|
"pointMotionU"
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
// Grab solid patch field
|
|
|
|
if
|
|
|
|
(
|
|
|
|
DU.boundaryField()[solidPatchID].type()
|
|
|
|
!= solidTractionFvPatchVectorField::typeName
|
2015-05-17 15:11:30 +00:00
|
|
|
//!= tractionDisplacementIncrementFvPatchVectorField::typeName
|
2012-09-11 15:42:55 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
FatalErrorIn(args.executable())
|
2014-06-01 18:12:52 +00:00
|
|
|
<< "Bounary condition on " << DU.name()
|
|
|
|
<< " is "
|
|
|
|
<< DU.boundaryField()[solidPatchID].type()
|
|
|
|
<< "for fluid -solid interface patch, instead "
|
2015-05-17 15:11:30 +00:00
|
|
|
<< solidTractionFvPatchVectorField::typeName
|
|
|
|
//<< tractionDisplacementIncrementFvPatchVectorField::typeName
|
2012-09-11 15:42:55 +00:00
|
|
|
<< 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
|
|
|
|
);
|
|
|
|
|
2019-01-25 16:22:44 +00:00
|
|
|
vectorField* accumulatedFluidInterfaceDisplacementPtr = nullptr;
|
2012-09-11 15:42:55 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
(
|
2014-06-01 18:12:52 +00:00
|
|
|
mesh.boundaryMesh()[fluidPatchID].nPoints(),
|
2012-09-11 15:42:55 +00:00
|
|
|
vector::zero
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-06-01 18:12:52 +00:00
|
|
|
vectorField& accumulatedFluidInterfaceDisplacement
|
2012-09-11 15:42:55 +00:00
|
|
|
= *accumulatedFluidInterfaceDisplacementPtr;
|
|
|
|
|