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

@ -13,40 +13,44 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicRefineFvMesh;
topoChanger
{
type refiner;
// Refine every refineInterval timesteps
refineInterval 1;
libs ("libfvMeshTopoChangers.so");
// Maximum refinement level (starts from 0)
maxRefinement 2;
// Refine every refineInterval timesteps
refineInterval 1;
// Maximum cell limit (approximate)
maxCells 10000;
// Maximum refinement level (starts from 0)
maxRefinement 2;
// volScalarField to base refinement on
field normalisedGradP;
// Maximum cell limit (approximate)
maxCells 10000;
nBufferLayers 1;
// volScalarField to base refinement on
field normalisedGradP;
dumpLevel true;
nBufferLayers 1;
lowerRefineLevel 0.5;
upperRefineLevel 1.5;
dumpLevel true;
unrefineLevel 0.5;
lowerRefineLevel 0.5;
upperRefineLevel 1.5;
nBufferLayers 1;
// Newly introduced patch points optionally get projected onto a surface
//projectSurfaces ("fixedWalls4.stl");
//projectPatches (fixedWalls);
// Maximum project distance
//projectDistance 1;
nBufferLayers 1;
// Newly introduced patch points optionally get projected onto a surface
//projectSurfaces ("fixedWalls4.stl");
//projectPatches (fixedWalls);
// Maximum project distance
//projectDistance 1;
// Fluxes to adapt. For newly created faces or split faces the flux
// gets estimated from an interpolated volVectorField ('velocity')
// First is name of the flux to adapt, second is velocity that will
// be interpolated and inner-producted with the face area vector.
correctFluxes ((phi rhoU) (phi_0 none));
}
// Fluxes to adapt. For newly created faces or split faces the flux
// gets estimated from an interpolated volVectorField ('velocity')
// First is name of the flux to adapt, second is velocity that will
// be interpolated and inner-producted with the face area vector.
correctFluxes ((phi rhoU) (phi_0 none));
// ************************************************************************* //

View File

@ -14,14 +14,17 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolverLibs ("libfvMotionSolvers.so");
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver velocityComponentLaplacian;
motionSolver velocityComponentLaplacian;
component x;
diffusivity directional (1 200 0);
component x;
diffusivity directional (1 200 0);
}
// ************************************************************************* //

View File

@ -16,16 +16,22 @@ FoamFile
#include "${FOAM_CASE}/constant/caseSettings"
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolver solidBody;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
cellZone rotatingZone;
motionSolver solidBody;
solidBodyMotionFunction rotatingMotion;
cellZone rotatingZone;
solidBodyMotionFunction rotatingMotion;
origin (0 0 0);
axis (0 0 1);
omega $!meshMotionProperties/omega;
}
origin (0 0 0);
axis (0 0 1);
omega $!meshMotionProperties/omega;
// ************************************************************************* //

View File

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
rm -r constant/polyMesh
rm log.*
#------------------------------------------------------------------------------

View File

@ -14,17 +14,22 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolver solidBody;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
cellZone rotating;
motionSolver solidBody;
solidBodyMotionFunction rotatingMotion;
cellZone rotating;
origin (0 0 0);
axis (1 0 0);
omega 6.2832;
solidBodyMotionFunction rotatingMotion;
origin (0 0 0);
axis (1 0 0);
omega 6.2832;
}
// ************************************************************************* //

View File

@ -14,18 +14,21 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolverLibs ("libfvMotionSolvers.so");
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver solidBody;
motionSolver solidBody;
cellZone inletChannel;
cellZone inletChannel;
solidBodyMotionFunction oscillatingLinearMotion;
solidBodyMotionFunction oscillatingLinearMotion;
amplitude (0 0.5 0);
omega 3.14; // rad/s (.5 rps)
amplitude (0 0.5 0);
omega 3.14; // rad/s (.5 rps)
}
// ************************************************************************* //

View File

@ -14,18 +14,22 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolverLibs ("libfvMotionSolvers.so");
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver solidBody;
motionSolver solidBody;
cellZone innerCylinder;
cellZone innerCylinder;
solidBodyMotionFunction rotatingMotion;
solidBodyMotionFunction rotatingMotion;
origin (0 0 0);
axis (0 1 0);
omega 158; // rad/s
}
origin (0 0 0);
axis (0 1 0);
omega 158; // rad/s
// ************************************************************************* //

View File

@ -13,73 +13,76 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libsixDoFRigidBodyMotion.so");
motionSolver sixDoFRigidBodyMotion;
patches (wing);
innerDistance 0.3;
outerDistance 1;
mass 22.9;
centreOfMass (0.4974612746 -0.01671895744 0.125);
momentOfInertia (1.958864357 3.920839234 2.057121362);
orientation
(
0.9953705935 0.09611129781 0
-0.09611129781 0.9953705935 0
0 0 1
);
angularMomentum (0 0 -2);
g (0 -9.81 0);
rho rhoInf;
rhoInf 1;
report on;
solver
mover
{
type symplectic;
}
type motionSolver;
constraints
{
yLine
libs ("libfvMeshMovers.so" "libsixDoFRigidBodyMotion.so");
motionSolver sixDoFRigidBodyMotion;
patches (wing);
innerDistance 0.3;
outerDistance 1;
mass 22.9;
centreOfMass (0.4974612746 -0.01671895744 0.125);
momentOfInertia (1.958864357 3.920839234 2.057121362);
orientation
(
0.9953705935 0.09611129781 0
-0.09611129781 0.9953705935 0
0 0 1
);
angularMomentum (0 0 -2);
g (0 -9.81 0);
rho rhoInf;
rhoInf 1;
report on;
solver
{
sixDoFRigidBodyMotionConstraint line;
centreOfRotation (0.25 0.007 0.125);
direction (0 1 0);
type symplectic;
}
zAxis
constraints
{
sixDoFRigidBodyMotionConstraint axis;
axis (0 0 1);
}
}
yLine
{
sixDoFRigidBodyMotionConstraint line;
centreOfRotation (0.25 0.007 0.125);
direction (0 1 0);
}
restraints
{
verticalSpring
{
sixDoFRigidBodyMotionRestraint linearSpring;
anchor (0.25 0.007 0.125);
refAttachmentPt (0.25 0.007 0.125);
stiffness 4000;
damping 2;
restLength 0;
zAxis
{
sixDoFRigidBodyMotionConstraint axis;
axis (0 0 1);
}
}
axialSpring
restraints
{
sixDoFRigidBodyMotionRestraint linearAxialAngularSpring;
verticalSpring
{
sixDoFRigidBodyMotionRestraint linearSpring;
axis (0 0 1);
stiffness 700;
damping 0.5;
referenceOrientation $orientation;
anchor (0.25 0.007 0.125);
refAttachmentPt (0.25 0.007 0.125);
stiffness 4000;
damping 2;
restLength 0;
}
axialSpring
{
sixDoFRigidBodyMotionRestraint linearAxialAngularSpring;
axis (0 0 1);
stiffness 700;
damping 0.5;
referenceOrientation $orientation;
}
}
}

View File

@ -14,16 +14,22 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolver solidBody;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
cellZone rotor;
motionSolver solidBody;
solidBodyMotionFunction rotatingMotion;
cellZone rotor;
solidBodyMotionFunction rotatingMotion;
origin (0 0 0);
axis (0 0 1);
omega 6.2832; // rad/s
}
origin (0 0 0);
axis (0 0 1);
omega 6.2832; // rad/s
// ************************************************************************* //

View File

@ -14,14 +14,17 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolverLibs ("libfvMotionSolvers.so");
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver velocityComponentLaplacian;
motionSolver velocityComponentLaplacian;
component x;
diffusivity directional (1 200 0);
component x;
diffusivity directional (1 200 0);
}
// ************************************************************************* //

View File

@ -14,31 +14,36 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolver multiSolidBodyMotionSolver;
multiSolidBodyMotionSolverCoeffs
mover
{
rotor
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0 0 0);
axis (0 0 1);
omega 6.2832; // rad/s
}
}
type motionSolver;
stator
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver multiSolidBodyMotionSolver;
multiSolidBodyMotionSolverCoeffs
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
rotor
{
origin (0 0 0);
axis (0 0 1);
omega -6.2832; // rad/s
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0 0 0);
axis (0 0 1);
omega 6.2832; // rad/s
}
}
stator
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0 0 0);
axis (0 0 1);
omega -6.2832; // rad/s
}
}
}
}

View File

@ -15,17 +15,21 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolverLibs ("libfvMotionSolvers.so");
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver displacementSBRStress; // displacementLaplacian;
// motionSolver velocityComponentLaplacian z;
motionSolver displacementSBRStress; // displacementLaplacian;
// motionSolver velocityComponentLaplacian z;
// diffusivity uniform;
// diffusivity directional (1 200 0);
// diffusivity motionDirectional (1 1000 0);
// diffusivity file motionDiffusivity;
diffusivity quadratic inverseDistance 1(minZ);
}
// diffusivity uniform;
// diffusivity directional (1 200 0);
// diffusivity motionDirectional (1 1000 0);
// diffusivity file motionDiffusivity;
diffusivity quadratic inverseDistance 1(minZ);
// ************************************************************************* //

View File

@ -14,23 +14,28 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolver solidBody;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
solidBodyMotionFunction SDA;
motionSolver solidBody;
CofG (0 0 0);
lamda 50;
rollAmax 0.22654;
rollAmin 0.10472;
heaveA 3.79;
swayA 2.34;
Q 2;
Tp 13.93;
Tpn 11.93;
dTi 0.059;
dTp -0.001;
solidBodyMotionFunction SDA;
CofG (0 0 0);
lamda 50;
rollAmax 0.22654;
rollAmin 0.10472;
heaveA 3.79;
swayA 2.34;
Q 2;
Tp 13.93;
Tpn 11.93;
dTi 0.059;
dTp -0.001;
}
// ************************************************************************* //

View File

@ -13,67 +13,70 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("librigidBodyMeshMotion.so");
motionSolver rigidBodyMotion;
report on;
solver
mover
{
type Newmark;
}
type motionSolver;
accelerationRelaxation 0.4;
libs ("libfvMeshMovers.so" "librigidBodyMeshMotion.so");
bodies
{
hull
motionSolver rigidBodyMotion;
report on;
solver
{
type rigidBody;
parent root;
type Newmark;
}
centreOfMass (0 0 0);
mass 412.73;
inertia (40 0 0 921 0 921);
transform (1 0 0 0 1 0 0 0 1) (2.929541 0 0.2);
accelerationRelaxation 0.4;
joint
bodies
{
hull
{
type composite;
joints
(
{
type Pz;
}
{
type Ry;
}
);
type rigidBody;
parent root;
centreOfMass (0 0 0);
mass 412.73;
inertia (40 0 0 921 0 921);
transform (1 0 0 0 1 0 0 0 1) (2.929541 0 0.2);
joint
{
type composite;
joints
(
{
type Pz;
}
{
type Ry;
}
);
}
patches (hull);
innerDistance 0.3;
outerDistance 1;
}
}
restraints
{
translationDamper
{
type linearDamper;
body hull;
coeff 8596;
}
patches (hull);
innerDistance 0.3;
outerDistance 1;
}
}
restraints
{
translationDamper
{
type linearDamper;
body hull;
coeff 8596;
}
rotationDamper
{
type sphericalAngularDamper;
body hull;
coeff 11586;
rotationDamper
{
type sphericalAngularDamper;
body hull;
coeff 11586;
}
}
}

View File

@ -13,56 +13,59 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libsixDoFRigidBodyMotion.so");
motionSolver sixDoFRigidBodyMotion;
patches (hull);
innerDistance 0.3;
outerDistance 1;
centreOfMass (2.929541 0 0.2);
mass 412.73;
momentOfInertia (40 921 921);
rhoInf 1;
report on;
value uniform (0 0 0);
accelerationRelaxation 0.4;
solver
mover
{
type Newmark;
}
type motionSolver;
constraints
{
zAxis
{
sixDoFRigidBodyMotionConstraint line;
direction (0 0 1);
}
yPlane
{
sixDoFRigidBodyMotionConstraint axis;
axis (0 1 0);
}
}
libs ("libfvMeshMovers.so" "libsixDoFRigidBodyMotion.so");
restraints
{
translationDamper
motionSolver sixDoFRigidBodyMotion;
patches (hull);
innerDistance 0.3;
outerDistance 1;
centreOfMass (2.929541 0 0.2);
mass 412.73;
momentOfInertia (40 921 921);
rhoInf 1;
report on;
value uniform (0 0 0);
accelerationRelaxation 0.4;
solver
{
sixDoFRigidBodyMotionRestraint linearDamper;
coeff 8596;
type Newmark;
}
rotationDamper
constraints
{
sixDoFRigidBodyMotionRestraint sphericalAngularDamper;
coeff 11586;
zAxis
{
sixDoFRigidBodyMotionConstraint line;
direction (0 0 1);
}
yPlane
{
sixDoFRigidBodyMotionConstraint axis;
axis (0 1 0);
}
}
restraints
{
translationDamper
{
sixDoFRigidBodyMotionRestraint linearDamper;
coeff 8596;
}
rotationDamper
{
sixDoFRigidBodyMotionRestraint sphericalAngularDamper;
coeff 11586;
}
}
}

View File

@ -14,67 +14,70 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("librigidBodyMeshMotion.so");
motionSolver rigidBodyMotion;
report on;
solver
mover
{
type Newmark;
}
type motionSolver;
accelerationRelaxation 0.4;
libs ("libfvMeshMovers.so" "librigidBodyMeshMotion.so");
bodies
{
hull
motionSolver rigidBodyMotion;
report on;
solver
{
type rigidBody;
parent root;
type Newmark;
}
centreOfMass (0 0 0);
mass 412.73;
inertia (40 0 0 921 0 921);
transform (1 0 0 0 1 0 0 0 1) (2.929541 0 0.2);
accelerationRelaxation 0.4;
joint
bodies
{
hull
{
type composite;
joints
(
{
type Pz;
}
{
type Ry;
}
);
type rigidBody;
parent root;
centreOfMass (0 0 0);
mass 412.73;
inertia (40 0 0 921 0 921);
transform (1 0 0 0 1 0 0 0 1) (2.929541 0 0.2);
joint
{
type composite;
joints
(
{
type Pz;
}
{
type Ry;
}
);
}
patches (hull);
innerDistance 0.3;
outerDistance 1;
}
}
restraints
{
translationDamper
{
type linearDamper;
body hull;
coeff 8596;
}
patches (hull);
innerDistance 0.3;
outerDistance 1;
}
}
restraints
{
translationDamper
{
type linearDamper;
body hull;
coeff 8596;
}
rotationDamper
{
type sphericalAngularDamper;
body hull;
coeff 11586;
rotationDamper
{
type sphericalAngularDamper;
body hull;
coeff 11586;
}
}
}

View File

@ -13,61 +13,64 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("librigidBodyMeshMotion.so");
motionSolver rigidBodyMotion;
rigidBodyMotionCoeffs
mover
{
report on;
type motionSolver;
solver
libs ("libfvMeshMovers.so" "librigidBodyMeshMotion.so");
motionSolver rigidBodyMotion;
rigidBodyMotionCoeffs
{
type Newmark;
}
report on;
accelerationRelaxation 0.7;
bodies
{
floatingObject
solver
{
type cuboid;
parent root;
type Newmark;
}
// Cuboid dimensions
Lx 0.3;
Ly 0.2;
Lz 0.5;
accelerationRelaxation 0.7;
// Density of the cuboid
rho 500;
// Cuboid mass
mass #calc "$rho*$Lx*$Ly*$Lz";
L ($Lx $Ly $Lz);
centreOfMass (0 0 0.25);
transform (1 0 0 0 1 0 0 0 1) (0.5 0.45 0.1);
joint
bodies
{
floatingObject
{
type composite;
joints
(
{
type Py;
}
{
type Ry;
}
);
}
type cuboid;
parent root;
patches (floatingObject);
innerDistance 0.05;
outerDistance 0.35;
// Cuboid dimensions
Lx 0.3;
Ly 0.2;
Lz 0.5;
// Density of the cuboid
rho 500;
// Cuboid mass
mass #calc "$rho*$Lx*$Ly*$Lz";
L ($Lx $Ly $Lz);
centreOfMass (0 0 0.25);
transform (1 0 0 0 1 0 0 0 1) (0.5 0.45 0.1);
joint
{
type composite;
joints
(
{
type Py;
}
{
type Ry;
}
);
}
patches (floatingObject);
innerDistance 0.05;
outerDistance 0.35;
}
}
}
}

View File

@ -13,78 +13,81 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libsixDoFRigidBodyMotion.so");
motionSolver sixDoFRigidBodyMotion;
sixDoFRigidBodyMotionCoeffs
mover
{
patches (floatingObject);
innerDistance 0.05;
outerDistance 0.35;
type motionSolver;
centreOfMass (0.5 0.45 0.35);
libs ("libfvMeshMovers.so" "libsixDoFRigidBodyMotion.so");
// Cuboid dimensions
Lx 0.3;
Ly 0.2;
Lz 0.5;
motionSolver sixDoFRigidBodyMotion;
// Density of the solid
rhoSolid 500;
// Cuboid mass
mass #calc "$rhoSolid*$Lx*$Ly*$Lz";
// Cuboid moment of inertia about the centre of mass
momentOfInertia #codeStream
sixDoFRigidBodyMotionCoeffs
{
codeInclude
#{
#include "diagTensor.H"
#};
patches (floatingObject);
innerDistance 0.05;
outerDistance 0.35;
code
#{
scalar sqrLx = sqr($Lx);
scalar sqrLy = sqr($Ly);
scalar sqrLz = sqr($Lz);
os <<
$mass
*diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0;
#};
};
centreOfMass (0.5 0.45 0.35);
report on;
accelerationRelaxation 0.7;
// accelerationDamping 0;
// Cuboid dimensions
Lx 0.3;
Ly 0.2;
Lz 0.5;
solver
{
type Newmark;
}
// Density of the solid
rhoSolid 500;
constraints
{
// fixedPoint
// {
// sixDoFRigidBodyMotionConstraint point;
// centreOfRotation (0.5 0.45 0.1);
// }
// Cuboid mass
mass #calc "$rhoSolid*$Lx*$Ly*$Lz";
fixedLine
// Cuboid moment of inertia about the centre of mass
momentOfInertia #codeStream
{
sixDoFRigidBodyMotionConstraint line;
centreOfRotation (0.5 0.45 0.1);
direction (0 1 0);
codeInclude
#{
#include "diagTensor.H"
#};
code
#{
scalar sqrLx = sqr($Lx);
scalar sqrLy = sqr($Ly);
scalar sqrLz = sqr($Lz);
os <<
$mass
*diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0;
#};
};
report on;
accelerationRelaxation 0.7;
// accelerationDamping 0;
solver
{
type Newmark;
}
fixedAxis
constraints
{
sixDoFRigidBodyMotionConstraint axis;
axis (0 1 0);
// fixedPoint
// {
// sixDoFRigidBodyMotionConstraint point;
// centreOfRotation (0.5 0.45 0.1);
// }
fixedLine
{
sixDoFRigidBodyMotionConstraint line;
centreOfRotation (0.5 0.45 0.1);
direction (0 1 0);
}
fixedAxis
{
sixDoFRigidBodyMotionConstraint axis;
axis (0 1 0);
}
}
}
}

View File

@ -14,19 +14,22 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolverLibs ( "libfvMotionSolvers.so" );
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver solidBody;
motionSolver solidBody;
cellZone rotating;
cellZone rotating;
solidBodyMotionFunction rotatingMotion;
solidBodyMotionFunction rotatingMotion;
origin (0 0 0);
axis (0 0 1);
omega -5; // 5 rad/s
origin (0 0 0);
axis (0 0 1);
omega -5; // 5 rad/s
}
// ************************************************************************* //

View File

@ -13,55 +13,58 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("librigidBodyMeshMotion.so");
motionSolver rigidBodyMotion;
report on;
solver
mover
{
type Newmark;
}
type motionSolver;
accelerationRelaxation 0.4;
libs ("libfvMeshMovers.so" "librigidBodyMeshMotion.so");
bodies
{
hull
motionSolver rigidBodyMotion;
report on;
solver
{
type rigidBody;
parent root;
type Newmark;
}
centreOfMass (0 0 0);
mass 16.146;
inertia (0.4 0 0 5 0 5);
transform (
0.9981507467 0 0.06078722637
0 1 0
-0.06078722637 0 0.9981507467
)
(0.586 0 0.156);
accelerationRelaxation 0.4;
joint
bodies
{
hull
{
type composite;
joints
(
{
type Pz;
}
{
type Ry;
}
);
}
type rigidBody;
parent root;
patches (hull);
innerDistance 0.02;
outerDistance 0.6;
centreOfMass (0 0 0);
mass 16.146;
inertia (0.4 0 0 5 0 5);
transform (
0.9981507467 0 0.06078722637
0 1 0
-0.06078722637 0 0.9981507467
)
(0.586 0 0.156);
joint
{
type composite;
joints
(
{
type Pz;
}
{
type Ry;
}
);
}
patches (hull);
innerDistance 0.02;
outerDistance 0.6;
}
}
}

View File

@ -14,26 +14,29 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolverLibs ( "libfvMotionSolvers.so" );
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver solidBody;
motionSolver solidBody;
cellZone innerCylinder;
cellZone innerCylinder;
solidBodyMotionFunction rotatingMotion;
solidBodyMotionFunction rotatingMotion;
origin (0 0 0);
axis (0 1 0);
omega table
(
(0 0)
(0.01 628)
(0.022 628)
(0.03 419)
(100 419)
);
origin (0 0 0);
axis (0 1 0);
omega table
(
(0 0)
(0.01 628)
(0.022 628)
(0.03 419)
(100 419)
);
}
// ************************************************************************* //

View File

@ -14,44 +14,48 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicRefineFvMesh;
topoChanger
{
type refiner;
// How often to refine
refineInterval 1;
libs ("libfvMeshTopoChangers.so");
// Field to be refinement on
field alpha.water;
mover none;
// Refine field in between lower..upper
lowerRefineLevel 0.001;
upperRefineLevel 0.999;
// How often to refine
refineInterval 1;
// If value < unrefineLevel unrefine
unrefineLevel 10;
// Field to be refinement on
field alpha.water;
// Have slower than 2:1 refinement
nBufferLayers 1;
// Refine field in between lower..upper
lowerRefineLevel 0.001;
upperRefineLevel 0.999;
// Refine cells only up to maxRefinement levels
maxRefinement 2;
// Have slower than 2:1 refinement
nBufferLayers 1;
// Stop refinement if maxCells reached
maxCells 200000;
// Refine cells only up to maxRefinement levels
maxRefinement 2;
// 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)
(ghf none)
);
// Stop refinement if maxCells reached
maxCells 200000;
// Write the refinement level as a volScalarField
dumpLevel true;
// 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)
(ghf none)
);
// Write the refinement level as a volScalarField
dumpLevel true;
}
// ************************************************************************* //

View File

@ -20,6 +20,7 @@ solvers
{
nAlphaCorr 1;
nAlphaSubCycles 3;
nLimiterIter 5;
}
p_rgh
@ -40,7 +41,7 @@ solvers
"pcorr.*"
{
$p_rghFinal;
tolerance 0.0001;
tolerance 1e-4;
}
U

View File

@ -14,30 +14,35 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolver solidBody;
solidBodyMotionFunction multiMotion;
oscillation
mover
{
solidBodyMotionFunction oscillatingLinearMotion;
oscillatingLinearMotionCoeffs
type motionSolver;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver solidBody;
solidBodyMotionFunction multiMotion;
oscillation
{
amplitude (0.1 0 0);
omega 18.8945578;
solidBodyMotionFunction oscillatingLinearMotion;
oscillatingLinearMotionCoeffs
{
amplitude (0.1 0 0);
omega 18.8945578;
}
}
}
rotation
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
rotation
{
origin (0 0.02 0);
axis (0 0 1);
omega 18.8945578;
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0 0.02 0);
axis (0 0 1);
omega 18.8945578;
}
}
}

View File

@ -14,23 +14,28 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolver solidBody;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
solidBodyMotionFunction SDA;
motionSolver solidBody;
CofG (0 0 0);
lamda 50;
rollAmax 0.22654;
rollAmin 0.10472;
heaveA 3.79;
swayA 2.34;
Q 2;
Tp 13.93;
Tpn 11.93;
dTi 0.059;
dTp -0.001;
solidBodyMotionFunction SDA;
CofG (0 0 0);
lamda 50;
rollAmax 0.22654;
rollAmin 0.10472;
heaveA 3.79;
swayA 2.34;
Q 2;
Tp 13.93;
Tpn 11.93;
dTi 0.059;
dTp -0.001;
}
// ************************************************************************* //

View File

@ -14,23 +14,28 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolver solidBody;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
solidBodyMotionFunction SDA;
motionSolver solidBody;
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;
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;
}
// ************************************************************************* //

View File

@ -14,23 +14,29 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolver solidBody;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
solidBodyMotionFunction SDA;
motionSolver solidBody;
solidBodyMotionFunction SDA;
CofG (0 0 0);
lamda 50;
rollAmax 0.22654;
rollAmin 0.10472;
heaveA 3.79;
swayA 2.34;
Q 2;
Tp 13.93;
Tpn 11.93;
dTi 0.059;
dTp -0.001;
}
CofG (0 0 0);
lamda 50;
rollAmax 0.22654;
rollAmin 0.10472;
heaveA 3.79;
swayA 2.34;
Q 2;
Tp 13.93;
Tpn 11.93;
dTi 0.059;
dTp -0.001;
// ************************************************************************* //

View File

@ -14,23 +14,72 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolver solidBody;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
solidBodyMotionFunction SDA;
motionSolver solidBody;
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;
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;
}
// ************************************************************************* //

View File

@ -22,7 +22,7 @@ startTime 0;
stopAt endTime;
endTime 40;
endTime 10;
deltaT 0.01;

View File

@ -26,7 +26,7 @@ gradSchemes
divSchemes
{
div(rhoPhi,U) Gauss vanLeerV;
div(rhoPhi,U) Gauss upwind;
div(phi,alpha) Gauss interfaceCompression vanLeer 1;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;

View File

@ -22,23 +22,6 @@ solvers
nAlphaSubCycles 3;
}
"pcorr.*"
{
solver PCG;
preconditioner
{
preconditioner GAMG;
tolerance 1e-05;
relTol 0;
smoother DICGaussSeidel;
cacheAgglomeration no;
}
tolerance 1e-05;
relTol 0;
maxIter 100;
}
p_rgh
{
solver GAMG;
@ -65,6 +48,12 @@ solvers
maxIter 20;
}
"pcorr.*"
{
$p_rghFinal;
tolerance 1e-4;
}
U
{
solver smoothSolver;
@ -78,9 +67,8 @@ solvers
PIMPLE
{
momentumPredictor no;
nCorrectors 2;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
correctPhi no;
pRefPoint (0 0 0.15);
pRefValue 1e5;

View File

@ -14,17 +14,22 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolver solidBody;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
solidBodyMotionFunction sixDoFMotion;
motionSolver solidBody;
CofG (0 0 0);
solidBodyMotionFunction sixDoFMotion;
translationRotation table;
// interpolationScheme spline;
file "$FOAM_CASE/constant/6DoF.dat";
CofG (0 0 0);
translationRotation table;
// interpolationScheme spline;
file "$FOAM_CASE/constant/6DoF.dat";
}
// ************************************************************************* //

View File

@ -14,45 +14,50 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolver solidBody;
solidBodyMotionFunction multiMotion;
// Table rotating in z axis
rotatingTable
mover
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
type motionSolver;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver solidBody;
solidBodyMotionFunction multiMotion;
// Table rotating in z axis
rotatingTable
{
origin (0 0.1 0);
axis (0 0 1);
omega 6.2832; // rad/s
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0 0.1 0);
axis (0 0 1);
omega 6.2832; // rad/s
}
}
}
//// Box rotates on rotating table
//rotatingBox
//{
// solidBodyMotionFunction rotatingMotion;
// rotatingMotionCoeffs
// {
// origin (0 0 0);
// axis (1 0 0);
// omega 12.5664; // rad/s
// }
//}
//// Box rotates on rotating table
//rotatingBox
//{
// solidBodyMotionFunction rotatingMotion;
// rotatingMotionCoeffs
// {
// origin (0 0 0);
// axis (1 0 0);
// omega 12.5664; // rad/s
// }
//}
// Tube rocking on rotating table
rotatingBox
{
solidBodyMotionFunction oscillatingRotatingMotion;
oscillatingRotatingMotionCoeffs
// Tube rocking on rotating table
rotatingBox
{
origin (0 0 0);
omega 40; // rad/s
amplitude (45 0 0); // 45 degrees max tilt
solidBodyMotionFunction oscillatingRotatingMotion;
oscillatingRotatingMotionCoeffs
{
origin (0 0 0);
omega 40; // rad/s
amplitude (45 0 0); // 45 degrees max tilt
}
}
}

View File

@ -14,16 +14,22 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolver solidBody;
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
cellZone rotor;
motionSolver solidBody;
solidBodyMotionFunction rotatingMotion;
cellZone rotor;
solidBodyMotionFunction rotatingMotion;
origin (0 0 0);
axis (0 0 1);
omega 6.2832; // rad/s
}
origin (0 0 0);
axis (0 0 1);
omega 6.2832; // rad/s
// ************************************************************************* //

View File

@ -15,16 +15,20 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
mover
{
type motionSolver;
motionSolverLibs ("libfvMotionSolvers.so");
libs ("libfvMeshMovers.so" "libfvMotionSolvers.so");
motionSolver displacementLaplacian;
motionSolver displacementLaplacian;
// diffusivity uniform;
// diffusivity directional (1 200 0);
// diffusivity motionDirectional (1 1000 0);
// diffusivity file motionDiffusivity;
diffusivity inverseDistance 1(floatingObjectBottom);
}
// diffusivity uniform;
// diffusivity directional (1 200 0);
// diffusivity motionDirectional (1 1000 0);
// diffusivity file motionDiffusivity;
diffusivity inverseDistance 1(floatingObjectBottom);
// ************************************************************************* //