fvMeshMovers, fvMeshTopoChangers: General mesh motion and topology change replacement for dynamicFvMesh

Mesh motion and topology change are now combinable run-time selectable options
within fvMesh, replacing the restrictive dynamicFvMesh which supported only
motion OR topology change.

All solvers which instantiated a dynamicFvMesh now instantiate an fvMesh which
reads the optional constant/dynamicFvMeshDict to construct an fvMeshMover and/or
an fvMeshTopoChanger.  These two are specified within the optional mover and
topoChanger sub-dictionaries of dynamicFvMeshDict.

When the fvMesh is updated the fvMeshTopoChanger is first executed which can
change the mesh topology in anyway, adding or removing points as required, for
example for automatic mesh refinement/unrefinement, and all registered fields
are mapped onto the updated mesh.  The fvMeshMover is then executed which moved
the points only and calculates the cell volume change and corresponding
mesh-fluxes for conservative moving mesh transport.  If multiple topological
changes or movements are required these would be combined into special
fvMeshMovers and fvMeshTopoChangers which handle the processing of a list of
changes, e.g. solidBodyMotionFunctions:multiMotion.

The tutorials/multiphase/interFoam/laminar/sloshingTank3D3DoF case has been
updated to demonstrate this new functionality by combining solid-body motion
with mesh refinement/unrefinement:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  dev
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

mover
{
    type    motionSolver;

    libs    ("libfvMeshMovers.so" "libfvMotionSolvers.so");

    motionSolver    solidBody;

    solidBodyMotionFunction SDA;

    CofG            (0 0 0);
    lamda           50;
    rollAmax        0.2;
    rollAmin        0.1;
    heaveA          4;
    swayA           2.4;
    Q               2;
    Tp              14;
    Tpn             12;
    dTi             0.06;
    dTp             -0.001;
}

topoChanger
{
    type    refiner;

    libs    ("libfvMeshTopoChangers.so");

    // How often to refine
    refineInterval  1;

    // Field to be refinement on
    field           alpha.water;

    // Refine field in between lower..upper
    lowerRefineLevel 0.001;
    upperRefineLevel 0.999;

    // Have slower than 2:1 refinement
    nBufferLayers   1;

    // Refine cells only up to maxRefinement levels
    maxRefinement   1;

    // Stop refinement if maxCells reached
    maxCells        200000;

    // Flux field and corresponding velocity field. Fluxes on changed
    // faces get recalculated by interpolating the velocity. Use 'none'
    // on surfaceScalarFields that do not need to be reinterpolated.
    correctFluxes
    (
        (phi none)
        (nHatf none)
        (rhoPhi none)
        (alphaPhi.water none)
        (meshPhi none)
        (meshPhi_0 none)
        (ghf none)
    );

    // Write the refinement level as a volScalarField
    dumpLevel       true;
}

// ************************************************************************* //

Note that currently this is the only working combination of mesh-motion with
topology change within the new framework and further development is required to
update the set of topology changers so that topology changes with mapping are
separated from the mesh-motion so that they can be combined with any of the
other movements or topology changes in any manner.

All of the solvers and tutorials have been updated to use the new form of
dynamicMeshDict but backward-compatibility was not practical due to the complete
reorganisation of the mesh change structure.
This commit is contained in:
Henry Weller
2021-10-01 15:50:06 +01:00
parent 167ad7442c
commit cf3d6cd1e9
175 changed files with 2586 additions and 1918 deletions

View File

@ -29,8 +29,6 @@ EXE_INC = \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
@ -45,6 +43,5 @@ EXE_LIBS = \
-lthermophysicalTransportModels \
-llaminarFlameSpeedModels \
-lfiniteVolume \
-ldynamicFvMesh \
-lfvModels \
-lfvConstraints

View File

@ -56,32 +56,33 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "psiuReactionThermo.H"
#include "compressibleMomentumTransportModels.H"
#include "fluidThermophysicalTransportModel.H"
#include "laminarFlameSpeed.H"
#include "XiModel.H"
#include "PDRDragModel.H"
#include "ignition.H"
#include "Switch.H"
#include "bound.H"
#include "dynamicRefineFvMesh.H"
#include "pimpleControl.H"
#include "fvModels.H"
#include "fvConstraints.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
pimpleControl pimple(mesh);
#include "createMesh.H"
#include "createControl.H"
#include "readCombustionProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "initContinuityErrs.H"
#include "createTimeControls.H"
#include "compressibleCourantNo.H"
@ -122,22 +123,22 @@ int main(int argc, char *argv[])
fvc::makeAbsolute(phi, rho, U);
// Test : disable refinement for some cells
PackedBoolList& protectedCell =
refCast<dynamicRefineFvMesh>(mesh).protectedCell();
// PackedBoolList& protectedCell =
// refCast<dynamicRefineFvMesh>(mesh).protectedCell();
if (protectedCell.empty())
{
protectedCell.setSize(mesh.nCells());
protectedCell = 0;
}
// if (protectedCell.empty())
// {
// protectedCell.setSize(mesh.nCells());
// protectedCell = 0;
// }
forAll(betav, celli)
{
if (betav[celli] < 0.99)
{
protectedCell[celli] = 1;
}
}
// forAll(betav, celli)
// {
// if (betav[celli] < 0.99)
// {
// protectedCell[celli] = 1;
// }
// }
// Flux estimate for introduced faces.
volVectorField rhoU("rhoU", rho*U);
@ -171,20 +172,21 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "UEqn.H"
fvModels.correct();
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "bEqn.H"
#include "ftEqn.H"
#include "huEqn.H"
#include "hEqn.H"
#include "EauEqn.H"
#include "EaEqn.H"
if (!ign.ignited())
{
hu == h;
thermo.heu() == thermo.he();
}
#include "pEqn.H"
@ -193,6 +195,7 @@ int main(int argc, char *argv[])
if (pimple.turbCorr())
{
turbulence->correct();
thermophysicalTransport->correct();
}
}

View File

@ -10,7 +10,6 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/meshTools/lnInclude \
@ -27,8 +26,6 @@ EXE_LIBS = \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-lfluidReactionThermophysicalTransportModels \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lfiniteVolume \
-lfvModels \
-lfvConstraints \

View File

@ -12,7 +12,6 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/meshTools/lnInclude \
@ -29,8 +28,6 @@ EXE_LIBS = \
-lchemistryModel \
-lODE \
-lcombustionModels \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lfiniteVolume \
-lfvModels \
-lfvConstraints \

View File

@ -35,7 +35,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "fluidReactionThermo.H"
#include "combustionModel.H"
#include "compressibleMomentumTransportModels.H"
@ -58,7 +57,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "createDyMControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"

View File

@ -5,7 +5,6 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \
@ -26,7 +25,6 @@ EXE_LIBS = \
-lfvConstraints \
-lsampling \
-lmeshTools \
-ldynamicFvMesh \
-lmomentumTransportModels \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \

View File

@ -34,7 +34,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "fluidReactionThermo.H"
#include "combustionModel.H"
#include "compressibleMomentumTransportModels.H"
@ -56,7 +55,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "createDyMControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"

View File

@ -7,7 +7,6 @@ EXE_INC = \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
@ -20,6 +19,4 @@ EXE_LIBS = \
-lmomentumTransportModels \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lmeshTools

View File

@ -31,7 +31,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "psiThermo.H"
#include "compressibleMomentumTransportModels.H"
#include "fluidThermophysicalTransportModel.H"
@ -49,7 +48,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createTimeControls.H"

View File

@ -7,8 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lfluidThermophysicalModels \
@ -17,8 +16,6 @@ EXE_LIBS = \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-lfiniteVolume \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lmeshTools \
-lsampling \
-lfvModels \

View File

@ -34,7 +34,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "fluidThermo.H"
#include "compressibleMomentumTransportModels.H"
#include "fluidThermophysicalTransportModel.H"
@ -54,7 +53,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "createDyMControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"

View File

@ -9,8 +9,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lfluidThermophysicalModels \
@ -19,8 +18,6 @@ EXE_LIBS = \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-lfiniteVolume \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lmeshTools \
-lsampling \
-lfvModels \

View File

@ -35,7 +35,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "fluidThermo.H"
#include "compressibleMomentumTransportModels.H"
#include "fluidThermophysicalTransportModel.H"
@ -56,7 +55,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "createDyMControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"

View File

@ -4,8 +4,6 @@ EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
EXE_LIBS = \
@ -16,7 +14,4 @@ EXE_LIBS = \
-lfvModels \
-lfvConstraints \
-lsampling \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-ldynamicMesh \
-lmeshTools

View File

@ -33,7 +33,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "viscosityModel.H"
#include "incompressibleMomentumTransportModels.H"
#include "pimpleControl.H"
@ -52,7 +51,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"

View File

@ -11,7 +11,6 @@ EXE_INC = \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
@ -23,8 +22,6 @@ EXE_LIBS = \
-lincompressibleMomentumTransportModels \
-lphaseIncompressibleMomentumTransportModels \
-lfiniteVolume \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lfvModels \
-lfvConstraints \
-lmeshTools

View File

@ -76,7 +76,6 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "viscosityModel.H"
#include "phaseIncompressibleMomentumTransportModel.H"
#include "pimpleControl.H"
@ -94,7 +93,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createUcfIfPresent.H"

View File

@ -7,7 +7,6 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
@ -20,6 +19,4 @@ EXE_LIBS = \
-lfiniteVolume \
-lregionModels \
-lsurfaceFilmModels \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lmeshTools

View File

@ -33,7 +33,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "viscosityModel.H"
#include "incompressibleMomentumTransportModels.H"
#include "parcelCloudList.H"
@ -47,7 +46,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "createFields.H"
#include "CourantNo.H"

View File

@ -10,8 +10,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
EXE_LIBS = \
-llagrangian \
@ -26,5 +25,4 @@ EXE_LIBS = \
-lfvConstraints \
-lmeshTools \
-lregionModels \
-lsurfaceFilmModels \
-ldynamicFvMesh
-lsurfaceFilmModels

View File

@ -32,7 +32,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "fluidThermo.H"
#include "compressibleMomentumTransportModels.H"
#include "parcelCloudList.H"
@ -46,7 +45,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "createFields.H"
#include "compressibleCourantNo.H"

View File

@ -7,7 +7,6 @@ EXE_INC = \
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
@ -16,7 +15,6 @@ EXE_LIBS = \
-lincompressibleMomentumTransportModels \
-lbarotropicCompressibilityModel \
-lfiniteVolume \
-ldynamicFvMesh \
-lfvModels \
-lfvConstraints \
-lmeshTools

View File

@ -34,7 +34,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "barotropicCompressibilityModel.H"
#include "incompressibleTwoPhaseMixture.H"
#include "incompressibleMomentumTransportModels.H"
@ -49,7 +48,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "createControls.H"
#include "createFields.H"
#include "createUfIfPresent.H"

View File

@ -14,8 +14,6 @@ EXE_INC = \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fvModels/lnInclude
@ -35,6 +33,4 @@ EXE_LIBS = \
-lfiniteVolume \
-lfvModels \
-lfvConstraints \
-lmeshTools \
-ldynamicMesh \
-ldynamicFvMesh
-lmeshTools

View File

@ -41,7 +41,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "CMULES.H"
#include "EulerDdtScheme.H"
#include "localEulerDdtScheme.H"
@ -64,7 +63,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"

View File

@ -11,7 +11,6 @@ EXE_INC = \
-I$(LIB_SRC)/MomentumTransportModels/phaseIncompressible/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
@ -22,8 +21,6 @@ EXE_LIBS = \
-lincompressibleMomentumTransportModels \
-lincompressibleInterPhaseTransportModel \
-lfiniteVolume \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lfvModels \
-lfvConstraints \
-lmeshTools

View File

@ -33,7 +33,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "CMULES.H"
#include "EulerDdtScheme.H"
#include "localEulerDdtScheme.H"
@ -57,7 +56,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"

View File

@ -11,7 +11,6 @@ EXE_INC = \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
@ -22,7 +21,6 @@ EXE_LIBS = \
-lmomentumTransportModels \
-lincompressibleMomentumTransportModels \
-lfiniteVolume \
-ldynamicFvMesh \
-lmeshTools \
-lfvModels \
-lfvConstraints \

View File

@ -32,7 +32,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "CMULES.H"
#include "localEulerDdtScheme.H"
#include "subCycle.H"
@ -53,7 +52,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"

View File

@ -9,8 +9,7 @@ EXE_INC = \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lphaseSystem \
@ -24,5 +23,4 @@ EXE_LIBS = \
-lfiniteVolume \
-lfvModels \
-lfvConstraints \
-lmeshTools \
-ldynamicFvMesh
-lmeshTools

View File

@ -34,7 +34,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "phaseSystem.H"
#include "phaseCompressibleMomentumTransportModel.H"
#include "pimpleControl.H"
@ -50,7 +49,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createFieldRefs.H"

View File

@ -6,7 +6,6 @@ EXE_INC = \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
@ -17,7 +16,6 @@ EXE_LIBS = \
-lmomentumTransportModels \
-lincompressibleMomentumTransportModels \
-lfiniteVolume \
-ldynamicFvMesh \
-lfvModels \
-lfvConstraints \
-lmeshTools \

View File

@ -34,7 +34,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "multiphaseMixture.H"
#include "incompressibleMomentumTransportModels.H"
#include "pimpleControl.H"
@ -51,7 +50,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"

View File

@ -3,7 +3,6 @@ EXE_INC = \
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
@ -12,8 +11,6 @@ EXE_LIBS = \
-lmomentumTransportModels \
-lincompressibleMomentumTransportModels \
-lfiniteVolume \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lmeshTools \
-lfvModels \
-lfvConstraints \

View File

@ -39,7 +39,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "viscosityModel.H"
#include "incompressibleMomentumTransportModels.H"
#include "pimpleControl.H"
@ -56,7 +55,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createMesh.H"
#include "initContinuityErrs.H"
#include "createDyMControls.H"
#include "createFields.H"

View File

@ -565,7 +565,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createMesh.H"
#include "createMeshNoChangers.H"
// Read control dictionary
// ~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -89,7 +89,7 @@ int main(int argc, char *argv[])
runTime.functionObjects().off();
instantList timeDirs = timeSelector::selectIfPresent(runTime, args);
#include "createMesh.H"
#include "createMeshNoChangers.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
const bool overwrite = args.optionFound("overwrite");
const bool fields = !args.optionFound("noFields");
#include "createMesh.H"
#include "createMeshNoChangers.H"
const word oldInstance = mesh.pointsInstance();
const word setName = args[1];

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,7 +42,7 @@ using std::ios;
Foam::fluentFvMesh::fluentFvMesh(const IOobject& io)
:
fvMesh(io)
fvMesh(io, false)
{}

View File

@ -370,7 +370,7 @@ int main(int argc, char *argv[])
sourceCaseDir
);
#include "createMesh.H"
#include "createMeshNoChangers.H"
const polyBoundaryMesh& patches = mesh.boundaryMesh();

View File

@ -790,7 +790,8 @@ Foam::backgroundMeshDecomposition::backgroundMeshDecomposition
IOobject::MUST_READ,
IOobject::AUTO_WRITE,
false
)
),
false
),
meshCutter_
(

View File

@ -378,7 +378,8 @@ Foam::cellShapeControlMesh::cellShapeControlMesh(const Time& runTime)
runTime,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
)
),
false
);
if (mesh.nPoints() == this->vertexCount())

View File

@ -333,7 +333,8 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
// instance,
// runTime_,
// IOobject::MUST_READ
// )
// ),
// false
// );
// pointIOField dualPoints
// (

View File

@ -517,7 +517,7 @@ int main(int argc, char *argv[])
// Distribute the initial mesh
if (Pstream::parRun())
{
#include "createMesh.H"
#include "createMeshNoChangers.H"
Info<< "Loaded mesh:" << endl;
printMeshData(mesh);

View File

@ -708,7 +708,8 @@ int main(int argc, char *argv[])
runTime.timeName(),
runTime,
Foam::IOobject::MUST_READ
)
),
false
)
);
}

View File

@ -49,7 +49,7 @@ int main(int argc, char *argv[])
const scalar scaleFactor = args.argRead<scalar>(1);
#include "createTime.H"
#include "createMesh.H"
#include "createMeshNoChangers.H"
volPointInterpolation pInterp(mesh);

View File

@ -31,7 +31,7 @@ License
Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io, const IOobject& dictIO)
:
fvMesh(io),
fvMesh(io, false),
mirrorMeshDict_(dictIO)
{
plane mirrorPlane(mirrorMeshDict_);

View File

@ -1,5 +1,4 @@
EXE_INC = \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
@ -7,7 +6,5 @@ EXE_INC = \
-I../checkMesh
EXE_LIBS = \
-ldynamicFvMesh \
-lmeshTools \
-lsampling \
-ldynamicMesh
-lsampling

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,7 +31,7 @@ Description
#include "argList.H"
#include "Time.H"
#include "dynamicFvMesh.H"
#include "fvMesh.H"
#include "pimpleControl.H"
#include "vtkSurfaceWriter.H"
#include "cyclicAMIPolyPatch.H"
@ -53,7 +53,33 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createNamedDynamicFvMesh.H"
Foam::word regionName;
if (args.optionReadIfPresent("region", regionName))
{
Foam::Info
<< "Create mesh " << regionName << " for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
}
else
{
regionName = Foam::fvMesh::defaultRegion;
Foam::Info
<< "Create mesh for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
}
Foam::fvMesh mesh
(
Foam::IOobject
(
regionName,
runTime.timeName(),
runTime,
Foam::IOobject::MUST_READ
)
);
const bool checkAMI = args.optionFound("checkAMI");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,7 +42,7 @@ int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createMeshNoChangers.H"
IOdictionary dynamicMeshDict
(

View File

@ -384,7 +384,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createMeshNoChangers.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -109,7 +109,7 @@ int main(int argc, char *argv[])
instantList timeDirs = timeSelector::select0(runTime, args);
#include "createMesh.H"
#include "createMeshNoChangers.H"
forAll(timeDirs, timeI)
{

View File

@ -957,7 +957,8 @@ int main(int argc, char *argv[])
regionName,
processorDb.timeName(),
processorDb
)
),
false
)
);
}

View File

@ -75,7 +75,7 @@ Foam::domainDecomposition::domainDecomposition
const fileName& dictFile
)
:
fvMesh(io),
fvMesh(io, false),
facesInstancePointsPtr_
(
pointsInstance() != facesInstance()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -269,7 +269,8 @@ int main(int argc, char *argv[])
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
),
false
);

View File

@ -383,7 +383,8 @@ int main(int argc, char *argv[])
regionName,
databases[proci].timeName(),
databases[proci]
)
),
false
);
// Initialise its addressing

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -214,7 +214,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
Pstream::parRun() = oldParRun;
}
autoPtr<fvMesh> meshPtr(new fvMesh(io));
autoPtr<fvMesh> meshPtr(new fvMesh(io, false));
fvMesh& mesh = meshPtr();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,7 +46,7 @@ int main(int argc, char *argv[])
instantList timeDirs = timeSelector::select0(runTime, args);
#include "createMesh.H"
#include "createMeshNoChangers.H"
// make a directory called proInterface in the case
mkDir(runTime.rootPath()/runTime.caseName()/"fluentInterface");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createMeshNoChangers.H"
#include "readConversionProperties.H"

View File

@ -156,7 +156,7 @@ int main(int argc, char *argv[])
// Read the mesh
#include "createMesh.H"
#include "createMeshNoChangers.H"
// Read the tetDualMesh
Info<< "Create tetDualMesh for time = "
@ -170,7 +170,8 @@ int main(int argc, char *argv[])
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
),
false
);
// From tet vertices to poly cells/faces
const labelIOList pointDualAddressing

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
if (fieldNameDict.found("epsilon")) nameMap.add("ED", word("epsilon"));
if (fieldNameDict.found("nuEff")) nameMap.add("VIS", word("nuEff"));
#include "createMesh.H"
#include "createMeshNoChangers.H"
IFstream smapFile(args[1]);

View File

@ -469,7 +469,8 @@ void Foam::vtkPVFoam::updateFoamMesh()
dbPtr_().timeName(),
dbPtr_(),
IOobject::MUST_READ
)
),
false
);
meshChanged_ = true;

View File

@ -75,7 +75,8 @@ int USERD_set_filenames
fvMesh::defaultRegion,
runTime.timeName(),
runTime
)
),
false
);
// set the available number of time-steps

View File

@ -56,7 +56,7 @@ int main(int argc, char *argv[])
// Get times list
instantList timeDirs = timeSelector::select0(runTime, args);
#include "createMesh.H"
#include "createMeshNoChangers.H"
#include "readPhysicalProperties.H"
const word& gFormat = runTime.graphFormat();

View File

@ -94,7 +94,7 @@ int main(int argc, char *argv[])
}
#include "createTime.H"
#include "createMesh.H"
#include "createMeshNoChangers.H"
#include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,7 +47,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createMeshNoChangers.H"
#include "createFields.H"
#include "readBoxTurbDict.H"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,7 +39,7 @@ int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createMeshNoChangers.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,7 +39,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createMeshNoChangers.H"
#include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -343,7 +343,8 @@ int main(int argc, char *argv[])
targetRegion,
runTimeTarget.timeName(),
runTimeTarget
)
),
false
);
Info<< "Target mesh size: " << meshTarget.nCells() << endl;
@ -368,7 +369,8 @@ int main(int argc, char *argv[])
sourceRegion,
runTimeSource.timeName(),
runTimeSource
)
),
false
);
Info<< "mesh size: " << meshSource.nCells() << endl;
@ -424,7 +426,8 @@ int main(int argc, char *argv[])
sourceRegion,
runTimeSource.timeName(),
runTimeSource
)
),
false
);
Info<< "Source mesh size: " << meshSource.nCells() << endl;
@ -447,7 +450,8 @@ int main(int argc, char *argv[])
targetRegion,
runTimeTarget.timeName(),
runTimeTarget
)
),
false
);
Info<< "mesh size: " << meshTarget.nCells() << endl;
@ -536,7 +540,8 @@ int main(int argc, char *argv[])
sourceRegion,
runTimeSource.timeName(),
runTimeSource
)
),
false
);
Info<< "mesh size: " << meshSource.nCells() << endl;
@ -571,7 +576,8 @@ int main(int argc, char *argv[])
targetRegion,
runTimeTarget.timeName(),
runTimeTarget
)
),
false
);
Info<< "mesh size: " << meshTarget.nCells() << endl;
@ -621,7 +627,8 @@ int main(int argc, char *argv[])
sourceRegion,
runTimeSource.timeName(),
runTimeSource
)
),
false
);
fvMesh meshTarget
@ -631,7 +638,8 @@ int main(int argc, char *argv[])
targetRegion,
runTimeTarget.timeName(),
runTimeTarget
)
),
false
);
Info<< "Source mesh size: " << meshSource.nCells() << tab

View File

@ -291,7 +291,8 @@ int main(int argc, char *argv[])
sourceRegion,
runTimeSource.timeName(),
runTimeSource
)
),
false
);
fvMesh meshTarget
@ -301,7 +302,8 @@ int main(int argc, char *argv[])
targetRegion,
runTimeTarget.timeName(),
runTimeTarget
)
),
false
);
Info<< "Source mesh size: " << meshSource.nCells() << tab

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,7 +35,7 @@ int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createMeshNoChangers.H"
IOdictionary mdInitialiseDict
(

View File

@ -13,9 +13,9 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover motionSolver;
motionSolverLibs ( "libfvMotionSolvers.so" );
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver solidBody;

View File

@ -13,9 +13,9 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover motionSolver;
motionSolverLibs ( "libfvMotionSolvers.so" );
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver solidBody;

View File

@ -46,8 +46,8 @@ wmake $targetType dynamicMesh
# Compile scotchDecomp, metisDecomp etc.
parallel/Allwmake $targetType $*
wmake $targetType dynamicFvMesh
wmake $targetType topoChangerFvMesh
wmake $targetType fvMeshMovers
wmake $targetType fvMeshTopoChangers
wmake $targetType conversion
wmake $targetType sampling

View File

@ -183,8 +183,11 @@ Foam::RASModel<BasicMomentumTransportModel>::New
template<class BasicMomentumTransportModel>
bool Foam::RASModel<BasicMomentumTransportModel>::read()
{
InfoInFunction << "Hmm" << endl;
if (BasicMomentumTransportModel::read())
{
InfoInFunction << "Hmm1" << endl;
RASDict_ <<= this->subDict("RAS");
RASDict_.lookup("turbulence") >> turbulence_;

View File

@ -196,8 +196,12 @@ kEpsilon<BasicMomentumTransportModel>::kEpsilon
template<class BasicMomentumTransportModel>
bool kEpsilon<BasicMomentumTransportModel>::read()
{
InfoInFunction << "Hmm" << endl;
if (eddyViscosity<RASModel<BasicMomentumTransportModel>>::read())
{
InfoInFunction << "Hmm1" << endl;
Cmu_.readIfPresent(this->coeffDict());
C1_.readIfPresent(this->coeffDict());
C2_.readIfPresent(this->coeffDict());

View File

@ -0,0 +1,15 @@
Foam::Info
<< "Create mesh for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
Foam::fvMesh mesh
(
Foam::IOobject
(
Foam::fvMesh::defaultRegion,
runTime.timeName(),
runTime,
Foam::IOobject::MUST_READ
),
false
);

View File

@ -22,5 +22,6 @@ Foam::fvMesh mesh
runTime.timeName(),
runTime,
Foam::IOobject::MUST_READ
)
),
false
);

View File

@ -1,9 +0,0 @@
dynamicFvMesh/dynamicFvMesh.C
dynamicFvMesh/dynamicFvMeshNew.C
staticFvMesh/staticFvMesh.C
dynamicMotionSolverFvMesh/dynamicMotionSolverFvMesh.C
dynamicInkJetFvMesh/dynamicInkJetFvMesh.C
dynamicInterpolatedFvMesh/dynamicInterpolatedFvMesh.C
dynamicRefineFvMesh/dynamicRefineFvMesh.C
LIB = $(FOAM_LIBBIN)/libdynamicFvMesh

View File

@ -1,79 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "staticFvMesh.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New(const IOobject& io)
{
typeIOobject<IOdictionary> dictHeader(dynamicMeshDictIOobject(io));
if (dictHeader.headerOk())
{
IOdictionary dict(dictHeader);
const word dynamicFvMeshTypeName(dict.lookup("dynamicFvMesh"));
Info<< "Selecting dynamicFvMesh " << dynamicFvMeshTypeName << endl;
libs.open
(
dict,
"dynamicFvMeshLibs",
IOobjectConstructorTablePtr_
);
if (!IOobjectConstructorTablePtr_)
{
FatalErrorInFunction
<< "dynamicFvMesh table is empty"
<< exit(FatalError);
}
IOobjectConstructorTable::iterator cstrIter =
IOobjectConstructorTablePtr_->find(dynamicFvMeshTypeName);
if (cstrIter == IOobjectConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown dynamicFvMesh type "
<< dynamicFvMeshTypeName << nl << nl
<< "Valid dynamicFvMesh types are :" << endl
<< IOobjectConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<dynamicFvMesh>(cstrIter()(io));
}
else
{
return autoPtr<dynamicFvMesh>(new staticFvMesh(io));
}
}
// ************************************************************************* //

View File

@ -1,18 +0,0 @@
Info<< "Create mesh for time = "
<< runTime.timeName() << nl << endl;
autoPtr<dynamicFvMesh> meshPtr
(
dynamicFvMesh::New
(
IOobject
(
dynamicFvMesh::defaultRegion,
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
)
);
dynamicFvMesh& mesh = meshPtr();

View File

@ -1,32 +0,0 @@
Foam::word regionName;
if (args.optionReadIfPresent("region", regionName))
{
Foam::Info
<< "Create mesh " << regionName << " for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
}
else
{
regionName = Foam::fvMesh::defaultRegion;
Foam::Info
<< "Create mesh for time = "
<< runTime.timeName() << Foam::nl << Foam::endl;
}
autoPtr<dynamicFvMesh> meshPtr
(
dynamicFvMesh::New
(
IOobject
(
regionName,
runTime.timeName(),
runTime,
IOobject::MUST_READ
)
)
);
dynamicFvMesh& mesh = meshPtr();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,7 +30,9 @@ Description
Example:
\verbatim
dynamicFvMesh dynamicMotionSolverFvMesh;
mover motionSolver;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver displacementLinearMotion;

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "points0MotionSolver.H"
#include "mapPolyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -80,70 +79,7 @@ void Foam::points0MotionSolver::movePoints(const pointField&)
void Foam::points0MotionSolver::updateMesh(const mapPolyMesh& mpm)
{
// pointMesh already updates pointFields
motionSolver::updateMesh(mpm);
// Map points0_. Bit special since we somehow have to come up with
// a sensible points0 position for introduced points.
// Find out scaling between points0 and current points
// Get the new points either from the map or the mesh
const pointField& points =
(
mpm.hasMotionPoints()
? mpm.preMotionPoints()
: mesh().points()
);
// Note: boundBox does reduce
const vector span0 = boundBox(points0_).span();
const vector span = boundBox(points).span();
vector scaleFactors(cmptDivide(span0, span));
pointField newPoints0(mpm.pointMap().size());
forAll(newPoints0, pointi)
{
label oldPointi = mpm.pointMap()[pointi];
if (oldPointi >= 0)
{
label masterPointi = mpm.reversePointMap()[oldPointi];
if (masterPointi == pointi)
{
newPoints0[pointi] = points0_[oldPointi];
}
else
{
// New point - assume motion is scaling
newPoints0[pointi] = points0_[oldPointi] + cmptMultiply
(
scaleFactors,
points[pointi] - points[masterPointi]
);
}
}
else
{
FatalErrorInFunction
<< "Cannot determine co-ordinates of introduced vertices."
<< " New vertex " << pointi << " at co-ordinate "
<< points[pointi] << exit(FatalError);
}
}
twoDCorrectPoints(newPoints0);
points0_.transfer(newPoints0);
// points0 changed - set to write and check-in to database
points0_.rename("points0");
points0_.writeOpt() = IOobject::AUTO_WRITE;
points0_.instance() = mesh().time().timeName();
points0_.checkIn();
NotImplemented;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,7 +36,6 @@ Description
SourceFiles
solidBodyMotionFunction.C
dynamicFvMeshNew.C
\*---------------------------------------------------------------------------*/

View File

@ -30,6 +30,7 @@ License
#include "cellSet.H"
#include "boolList.H"
#include "syncTools.H"
#include "mapPolyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -56,7 +57,8 @@ Foam::solidBodyMotionSolver::solidBodyMotionSolver
points0MotionSolver(mesh, dict, typeName),
SBMFPtr_(solidBodyMotionFunction::New(coeffDict(), mesh.time())),
pointIDs_(),
moveAllCells_(false)
moveAllCells_(false),
transform_(SBMFPtr_().transformation())
{
word cellZoneName =
coeffDict().lookupOrDefault<word>("cellZone", "none");
@ -156,9 +158,11 @@ Foam::solidBodyMotionSolver::~solidBodyMotionSolver()
Foam::tmp<Foam::pointField> Foam::solidBodyMotionSolver::curPoints() const
{
transform_ = SBMFPtr_().transformation();
if (moveAllCells_)
{
return transformPoints(SBMFPtr_().transformation(), points0_);
return transformPoints(transform_, points0_);
}
else
{
@ -167,7 +171,7 @@ Foam::tmp<Foam::pointField> Foam::solidBodyMotionSolver::curPoints() const
UIndirectList<point>(transformedPts, pointIDs_) = transformPoints
(
SBMFPtr_().transformation(),
transform_,
pointField(points0_, pointIDs_)
);
@ -176,4 +180,63 @@ Foam::tmp<Foam::pointField> Foam::solidBodyMotionSolver::curPoints() const
}
void Foam::solidBodyMotionSolver::updateMesh(const mapPolyMesh& mpm)
{
// pointMesh already updates pointFields
motionSolver::updateMesh(mpm);
// Map points0_. Bit special since we somehow have to come up with
// a sensible points0 position for introduced points.
// Find out scaling between points0 and current points
// Get the new points either from the map or the mesh
const pointField& points =
(
mpm.hasMotionPoints()
? mpm.preMotionPoints()
: mesh().points()
);
pointField newPoints0(mpm.pointMap().size());
forAll(newPoints0, pointi)
{
label oldPointi = mpm.pointMap()[pointi];
if (oldPointi >= 0)
{
label masterPointi = mpm.reversePointMap()[oldPointi];
if (masterPointi == pointi)
{
newPoints0[pointi] = points0_[oldPointi];
}
else
{
newPoints0[pointi] =
transform_.invTransformPoint(points[pointi]);
}
}
else
{
FatalErrorInFunction
<< "Cannot determine co-ordinates of introduced vertices."
<< " New vertex " << pointi << " at co-ordinate "
<< points[pointi] << exit(FatalError);
}
}
twoDCorrectPoints(newPoints0);
points0_.transfer(newPoints0);
// points0 changed - set to write and check-in to database
points0_.rename("points0");
points0_.writeOpt() = IOobject::AUTO_WRITE;
points0_.instance() = mesh().time().timeName();
points0_.checkIn();
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -63,6 +63,9 @@ class solidBodyMotionSolver
//- Flag to indicate whether all cells should move
bool moveAllCells_;
//- Cache the current transform for updateMesh
mutable septernion transform_;
public:
@ -96,6 +99,9 @@ public:
virtual void solve()
{}
//- Update local data for topology changes
virtual void updateMesh(const mapPolyMesh&);
// Member Operators

View File

@ -93,6 +93,18 @@ $(faceToCell)/extendedFaceToCellStencil.C
$(faceToCell)/extendedCentredFaceToCellStencil.C
$(faceToCell)/MeshObjects/centredCFCFaceToCellStencilObject.C
fvMeshMovers = fvMesh/fvMeshMovers
$(fvMeshMovers)/fvMeshMover/fvMeshMover.C
$(fvMeshMovers)/fvMeshMover/fvMeshMoverNew.C
$(fvMeshMovers)/none/fvMeshMoversNone.C
fvMeshTopoChangers = fvMesh/fvMeshTopoChangers
$(fvMeshTopoChangers)/fvMeshTopoChanger/fvMeshTopoChanger.C
$(fvMeshTopoChangers)/fvMeshTopoChanger/fvMeshTopoChangerNew.C
$(fvMeshTopoChangers)/none/fvMeshTopoChangersNone.C
functionObjects/fvMeshFunctionObject/fvMeshFunctionObject.C
functionObjects/volRegion/volRegion.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -31,12 +31,16 @@ License
#include "SubField.H"
#include "demandDrivenData.H"
#include "fvMeshLduAddressing.H"
#include "fvMeshTopoChanger.H"
#include "fvMeshMover.H"
#include "mapPolyMesh.H"
#include "MapFvFields.H"
#include "fvMeshMapper.H"
#include "mapClouds.H"
#include "MeshObject.H"
#include "fvcSurfaceIntegrate.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
@ -253,7 +257,7 @@ void Foam::fvMesh::clearOut()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvMesh::fvMesh(const IOobject& io)
Foam::fvMesh::fvMesh(const IOobject& io, const bool changers)
:
polyMesh(io),
surfaceInterpolation(*this),
@ -261,6 +265,18 @@ Foam::fvMesh::fvMesh(const IOobject& io)
fvSolution(static_cast<const objectRegistry&>(*this)),
data(static_cast<const objectRegistry&>(*this)),
boundary_(*this, boundaryMesh()),
topoChanger_
(
changers
? fvMeshTopoChanger::New(*this)
: autoPtr<fvMeshTopoChanger>(nullptr)
),
mover_
(
changers
? fvMeshMover::New(*this)
: autoPtr<fvMeshMover>(nullptr)
),
lduPtr_(nullptr),
curTimeIndex_(time().timeIndex()),
VPtr_(nullptr),
@ -451,6 +467,21 @@ Foam::fvMesh::~fvMesh()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::fvMesh::dynamic() const
{
return topoChanger_->dynamic() || mover_->dynamic();
}
bool Foam::fvMesh::update()
{
// return !(!topoChanger_->update() && !mover_->update());
topoChanger_->update();
mover_->update();
return true;
}
void Foam::fvMesh::addFvPatches
(
const List<polyPatch*> & p,
@ -554,6 +585,18 @@ const Foam::lduAddressing& Foam::fvMesh::lduAddr() const
}
const Foam::fvMeshTopoChanger& Foam::fvMesh::topoChanger() const
{
return topoChanger_();
}
const Foam::fvMeshMover& Foam::fvMesh::mover() const
{
return mover_();
}
void Foam::fvMesh::mapFields(const mapPolyMesh& meshMap)
{
if (debug)
@ -847,6 +890,17 @@ void Foam::fvMesh::updateMesh(const mapPolyMesh& mpm)
meshObject::updateMesh<fvMesh>(*this, mpm);
meshObject::updateMesh<lduMesh>(*this, mpm);
if (mover_.valid())
{
mover_->updateMesh(mpm);
// Reset the old-time cell volumes prior to mesh-motion
if (V0Ptr_)
{
*V0Ptr_ = V();
}
}
}
@ -1086,6 +1140,16 @@ bool Foam::fvMesh::writeObject
ok = ok && V0Ptr_->write(write);
}
if (topoChanger_.valid())
{
topoChanger_->write(write);
}
if (mover_.valid())
{
mover_->write(write);
}
return ok && polyMesh::writeObject(fmt, ver, cmp, write);
}

View File

@ -69,6 +69,8 @@ namespace Foam
{
class fvMeshLduAddressing;
class fvMeshTopoChanger;
class fvMeshMover;
class volMesh;
class mapDistributePolyMesh;
@ -90,6 +92,12 @@ class fvMesh
//- Boundary mesh
fvBoundaryMesh boundary_;
//- The topo-changer function class
autoPtr<fvMeshTopoChanger> topoChanger_;
//- The mover function class
autoPtr<fvMeshMover> mover_;
// Demand-driven data
@ -171,7 +179,8 @@ public:
// Constructors
//- Construct from IOobject
explicit fvMesh(const IOobject& io);
// with the option to not instantiate the mesh changers
explicit fvMesh(const IOobject& io, const bool changers = true);
//- Construct from cellShapes with boundary.
fvMesh
@ -287,6 +296,12 @@ public:
return lduAddr().upperAddr();
}
//- Return the topo-changer function class
const fvMeshTopoChanger& topoChanger() const;
//- Return the mover function class
const fvMeshMover& mover() const;
//- Return cell volumes
const DimensionedField<scalar, volMesh>& V() const;
@ -329,6 +344,12 @@ public:
// Edit
//- Is mesh dynamic
virtual bool dynamic() const;
//- Update the mesh for both mesh motion and topology change
virtual bool update();
//- Clear all geometry and addressing
void clearOut();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,94 +23,45 @@ License
\*---------------------------------------------------------------------------*/
#include "dynamicFvMesh.H"
#include "fvMeshMover.H"
#include "volFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(dynamicFvMesh, 0);
defineRunTimeSelectionTable(dynamicFvMesh, IOobject);
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam::IOobject Foam::dynamicFvMesh::dynamicMeshDictIOobject(const IOobject& io)
{
// defaultRegion (region0) gets loaded from constant, other ones get loaded
// from constant/<regionname>. Normally we'd use polyMesh::dbDir() but we
// haven't got a polyMesh yet ...
return IOobject
(
"dynamicMeshDict",
io.time().constant(),
(io.name() == polyMesh::defaultRegion ? "" : io.name()),
io.db(),
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
);
defineTypeNameAndDebug(fvMeshMover, 0);
defineRunTimeSelectionTable(fvMeshMover, fvMesh);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dynamicFvMesh::dynamicFvMesh(const IOobject& io)
Foam::fvMeshMover::fvMeshMover(fvMesh& mesh)
:
fvMesh(io),
dynamicMeshDict_(IOdictionary(dynamicMeshDictIOobject(io)))
{}
Foam::dynamicFvMesh::dynamicFvMesh
(
const IOobject& io,
pointField&& points,
faceList&& faces,
labelList&& allOwner,
labelList&& allNeighbour,
const bool syncPar
)
:
fvMesh
mesh_(mesh),
dynamicMeshDict_
(
io,
move(points),
move(faces),
move(allOwner),
move(allNeighbour),
syncPar
),
dynamicMeshDict_(IOdictionary(dynamicMeshDictIOobject(io)))
IOdictionary
(
IOobject
(
"dynamicMeshDict",
mesh.time().constant(),
mesh.dbDir(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
)
)
)
{}
Foam::dynamicFvMesh::dynamicFvMesh
Foam::fvMeshMover::velocityMotionCorrection::velocityMotionCorrection
(
const IOobject& io,
pointField&& points,
faceList&& faces,
cellList&& cells,
const bool syncPar
)
:
fvMesh
(
io,
move(points),
move(faces),
move(cells),
syncPar
),
dynamicMeshDict_(IOdictionary(dynamicMeshDictIOobject(io)))
{}
Foam::dynamicFvMesh::velocityMotionCorrection::velocityMotionCorrection
(
const dynamicFvMesh& mesh,
const fvMesh& mesh,
const dictionary& dict
)
:
@ -121,13 +72,13 @@ Foam::dynamicFvMesh::velocityMotionCorrection::velocityMotionCorrection
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::dynamicFvMesh::~dynamicFvMesh()
Foam::fvMeshMover::~fvMeshMover()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::dynamicFvMesh::velocityMotionCorrection::update() const
void Foam::fvMeshMover::velocityMotionCorrection::update() const
{
forAll(velocityFields_, i)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,19 +22,22 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::dynamicFvMesh
Foam::fvMeshMover
Description
Abstract base class for geometry and/or topology changing fvMesh.
Abstract base class for fvMesh movers.
These classes move the mesh points, update the cell volumes and generate
the corresponding mesh fluxes without any topology change.
SourceFiles
dynamicFvMesh.C
dynamicFvMeshNew.C
fvMeshMover.C
fvMeshMoverNew.C
\*---------------------------------------------------------------------------*/
#ifndef dynamicFvMesh_H
#define dynamicFvMesh_H
#ifndef fvMeshMover_H
#define fvMeshMover_H
#include "fvMesh.H"
@ -44,29 +47,24 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class dynamicFvMesh Declaration
Class fvMeshMover Declaration
\*---------------------------------------------------------------------------*/
class dynamicFvMesh
:
public fvMesh
class fvMeshMover
{
// Private Data
//- Non-const fvMesh reference to allow update
fvMesh& mesh_;
//- The dynamicMeshDict
dictionary dynamicMeshDict_;
// Private Member Functions
//- Return the dynamicMeshDict IOobject
static IOobject dynamicMeshDictIOobject(const IOobject& io);
public:
//- Runtime type information
TypeName("dynamicFvMesh");
TypeName("fvMeshMover");
// Declare run-time constructor selection table
@ -74,10 +72,10 @@ public:
declareRunTimeSelectionTable
(
autoPtr,
dynamicFvMesh,
IOobject,
(const IOobject& io),
(io)
fvMeshMover,
fvMesh,
(fvMesh& mesh),
(mesh)
);
@ -87,7 +85,7 @@ public:
{
// Private Data
const dynamicFvMesh& mesh_;
const fvMesh& mesh_;
wordList velocityFields_;
@ -97,7 +95,7 @@ public:
velocityMotionCorrection
(
const dynamicFvMesh& mesh,
const fvMesh& mesh,
const dictionary& dict
);
@ -110,70 +108,63 @@ public:
// Constructors
//- Construct from objectRegistry, and read/write options
explicit dynamicFvMesh(const IOobject& io);
//- Construct from components without boundary.
// Boundary is added using addFvPatches() member function
dynamicFvMesh
(
const IOobject& io,
pointField&& points,
faceList&& faces,
labelList&& allOwner,
labelList&& allNeighbour,
const bool syncPar = true
);
//- Construct without boundary from cells rather than owner/neighbour.
// Boundary is added using addPatches() member function
dynamicFvMesh
(
const IOobject& io,
pointField&& points,
faceList&& faces,
cellList&& cells,
const bool syncPar = true
);
//- Construct from fvMesh
explicit fvMeshMover(fvMesh&);
//- Disallow default bitwise copy construction
dynamicFvMesh(const dynamicFvMesh&) = delete;
fvMeshMover(const fvMeshMover&) = delete;
// Selectors
//- Select, construct and return the dynamicFvMesh
//- Select, construct and return the fvMeshMover
// If the constant/dynamicMeshDict does not exist
// a staticFvMesh is returned
static autoPtr<dynamicFvMesh> New(const IOobject& io);
static autoPtr<fvMeshMover> New(fvMesh&);
//- Destructor
virtual ~dynamicFvMesh();
virtual ~fvMeshMover();
// Member Functions
//- Return the dynamicMeshDict
const dictionary& dynamicMeshDict() const
//- Return the fvMesh
fvMesh& mesh()
{
return dynamicMeshDict_;
return mesh_;
}
//- Is mesh dynamic
//- Return the dynamicMeshDict/mover dict
const dictionary& dict() const
{
return dynamicMeshDict_.subDict("mover");
}
//- Is mesh dynamic, i.e. might it change?
// Defaults to true, set to false in the fvMeshMovers::none
virtual bool dynamic() const
{
return true;
}
//- Update local data for topology changes
virtual void updateMesh(const mapPolyMesh&) = 0;
//- Update the mesh for both mesh motion and topology change
virtual bool update() = 0;
//- Write the mover state
virtual bool write(const bool write = true) const
{
return true;
}
// Member Operators
//- Disallow default bitwise assignment
void operator=(const dynamicFvMesh&) = delete;
void operator=(const fvMeshMover&) = delete;
};

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fvMeshMoversNone.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::fvMeshMover> Foam::fvMeshMover::New(fvMesh& mesh)
{
typeIOobject<IOdictionary> dictHeader
(
IOobject
(
"dynamicMeshDict",
mesh.time().constant(),
mesh.dbDir(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
)
);
if (dictHeader.headerOk())
{
IOdictionary dict(dictHeader);
if (dict.found("mover"))
{
const dictionary& moverDict = dict.subDict("mover");
const word fvMeshMoverTypeName(moverDict.lookup("type"));
Info<< "Selecting fvMeshMover " << fvMeshMoverTypeName << endl;
libs.open
(
moverDict,
"libs",
fvMeshConstructorTablePtr_
);
if (!fvMeshConstructorTablePtr_)
{
FatalErrorInFunction
<< "fvMeshMovers table is empty"
<< exit(FatalError);
}
fvMeshConstructorTable::iterator cstrIter =
fvMeshConstructorTablePtr_->find(fvMeshMoverTypeName);
if (cstrIter == fvMeshConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown fvMeshMover type "
<< fvMeshMoverTypeName << nl << nl
<< "Valid fvMeshMovers are :" << endl
<< fvMeshConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<fvMeshMover>(cstrIter()(mesh));
}
}
return autoPtr<fvMeshMover>(new fvMeshMovers::none(mesh));
}
// ************************************************************************* //

View File

@ -0,0 +1,63 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fvMeshMoversNone.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fvMeshMovers
{
defineTypeNameAndDebug(none, 0);
addToRunTimeSelectionTable(fvMeshMover, none, fvMesh);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvMeshMovers::none::none(fvMesh& mesh)
:
fvMeshMover(mesh)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::fvMeshMovers::none::~none()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::fvMeshMovers::none::update()
{
return false;
}
// ************************************************************************* //

View File

@ -0,0 +1,106 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fvMeshMovers::none
Description
Dummy fvMeshMover which does not move the mesh points
SourceFiles
none.C
\*---------------------------------------------------------------------------*/
#ifndef fvMeshMoversNone_H
#define fvMeshMoversNone_H
#include "fvMeshMover.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fvMeshMovers
{
/*---------------------------------------------------------------------------*\
Class fvMeshMovers::none Declaration
\*---------------------------------------------------------------------------*/
class none
:
public fvMeshMover
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from fvMesh
none(fvMesh& mesh);
//- Disallow default bitwise copy construction
none(const none&) = delete;
//- Destructor
~none();
// Member Functions
//- The mesh is static and does not change so return false
virtual bool dynamic() const
{
return false;
}
//- Update local data for topology changes
virtual void updateMesh(const mapPolyMesh&)
{}
//- Dummy update function which does not change the mesh
virtual bool update();
// Member Operators
//- Disallow default bitwise assignment
void operator=(const none&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fvMeshMovers
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,95 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fvMeshTopoChanger.H"
#include "volFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(fvMeshTopoChanger, 0);
defineRunTimeSelectionTable(fvMeshTopoChanger, fvMesh);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvMeshTopoChanger::fvMeshTopoChanger(fvMesh& mesh)
:
mesh_(mesh),
dynamicMeshDict_
(
IOdictionary
(
IOobject
(
"dynamicMeshDict",
mesh.time().constant(),
mesh.dbDir(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
)
)
)
{}
Foam::fvMeshTopoChanger::velocityMotionCorrection::velocityMotionCorrection
(
const fvMesh& mesh,
const dictionary& dict
)
:
mesh_(mesh),
velocityFields_(dict.lookupOrDefault("velocityFields", wordList()))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::fvMeshTopoChanger::~fvMeshTopoChanger()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fvMeshTopoChanger::velocityMotionCorrection::update() const
{
forAll(velocityFields_, i)
{
if (mesh_.foundObject<volVectorField>(velocityFields_[i]))
{
mesh_.lookupObjectRef<volVectorField>
(
velocityFields_[i]
).correctBoundaryConditions();
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,182 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fvMeshTopoChanger
Description
Abstract base class for fvMesh movers.
These classes move the mesh points, update the cell volumes and generate
the corresponding mesh fluxes without any topology change.
SourceFiles
fvMeshTopoChanger.C
fvMeshTopoChangerNew.C
\*---------------------------------------------------------------------------*/
#ifndef fvMeshTopoChanger_H
#define fvMeshTopoChanger_H
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fvMeshTopoChanger Declaration
\*---------------------------------------------------------------------------*/
class fvMeshTopoChanger
{
// Private Data
//- Non-const fvMesh reference to allow update
fvMesh& mesh_;
//- The dynamicMeshDict
dictionary dynamicMeshDict_;
public:
//- Runtime type information
TypeName("fvMeshTopoChanger");
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
fvMeshTopoChanger,
fvMesh,
(fvMesh& mesh),
(mesh)
);
//- Helper class to update the velocity boundary conditions
// following mesh motion
class velocityMotionCorrection
{
// Private Data
const fvMesh& mesh_;
wordList velocityFields_;
public:
// Constructors
velocityMotionCorrection
(
const fvMesh& mesh,
const dictionary& dict
);
// Member Functions
void update() const;
};
// Constructors
//- Construct from fvMesh
explicit fvMeshTopoChanger(fvMesh&);
//- Disallow default bitwise copy construction
fvMeshTopoChanger(const fvMeshTopoChanger&) = delete;
// Selectors
//- Select, construct and return the fvMeshTopoChanger
// If the constant/dynamicMeshDict does not exist
// a staticFvMesh is returned
static autoPtr<fvMeshTopoChanger> New(fvMesh&);
//- Destructor
virtual ~fvMeshTopoChanger();
// Member Functions
//- Return the fvMesh
fvMesh& mesh()
{
return mesh_;
}
//- Return the fvMesh
const fvMesh& mesh() const
{
return mesh_;
}
//- Return the dynamicMeshDict/topoChanger sub-dict
const dictionary& dict() const
{
return dynamicMeshDict_.subDict("topoChanger");
}
//- Is mesh dynamic, i.e. might it change?
// Defaults to true, set to false in the fvMeshTopoChangers::none
virtual bool dynamic() const
{
return true;
}
//- Update the mesh for both mesh motion and topology change
virtual bool update() = 0;
//- Write the mover state
virtual bool write(const bool write = true) const
{
return true;
}
// Member Operators
//- Disallow default bitwise assignment
void operator=(const fvMeshTopoChanger&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More