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/viscoElasticSolidFoam/createFluid.H

51 lines
1.3 KiB
C++
Raw Normal View History

fileName casePath(args.additionalArgs()[0]);
fileName fluidRootDir = casePath.path();
fileName fluidCaseDir = casePath.name();
Info<< "Fluid: " << fluidRootDir << " " << fluidCaseDir << endl;
Time fluidRunTime
(
Time::controlDictName,
fluidRootDir,
fluidCaseDir
);
fluidRunTime.setDeltaT(runTime.deltaT().value());
fvMesh fluidMesh
(
IOobject
(
fvMesh::defaultRegion,
fluidRunTime.timeName(),
fluidRunTime
)
);
label fluidInterfacePatchID =
fluidMesh.boundaryMesh().findPatchID("interface");
if(fluidInterfacePatchID == -1)
{
FatalErrorIn(args.executable())
<< "Can't find patch with name interface" << abort(FatalError);
}
patchToPatchInterpolation interpolator
(
fluidMesh.boundaryMesh()[fluidInterfacePatchID],
mesh.boundaryMesh()[interfacePatchID],
intersection::VISIBLE
);
scalarField error =
mag
(
mesh.C().boundaryField()[interfacePatchID]
- interpolator.faceInterpolate(fluidMesh.C().boundaryField()[fluidInterfacePatchID])
);
Info << "Patch-to-patch interpolation error, max: " << max(error) << ", avg: " << average(error) << endl;