When snappyHexMesh is run in parallel it re-balances the mesh during refinement
and layer addition by redistribution which requires a decomposition method
that operates in parallel, e.g. hierachical or ptscotch. decomposePar uses a
decomposition method which operates in serial e.g. hierachical but NOT
ptscotch. In order to run decomposePar followed by snappyHexMesh in parallel it
has been necessary to change the method specified in decomposeParDict but now
this is avoided by separately specifying the decomposition and distribution
methods, e.g. in the incompressible/simpleFoam/motorBike case:
numberOfSubdomains 6;
decomposer hierarchical;
distributor ptscotch;
hierarchicalCoeffs
{
n (3 2 1);
order xyz;
}
The distributor entry is also used for run-time mesh redistribution, e.g. in the
multiphase/interFoam/RAS/floatingObject case re-distribution for load-balancing
is enabled in constant/dynamicMeshDict:
distributor
{
type distributor;
libs ("libfvMeshDistributors.so");
redistributionInterval 10;
}
which uses the distributor specified in system/decomposeParDict:
distributor hierarchical;
This rationalisation provides the structure for development of mesh
redistribution and load-balancing.
134 lines
3.2 KiB
C++
134 lines
3.2 KiB
C++
/*--------------------------------*- 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;
|
|
object motionProperties;
|
|
}
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
mover
|
|
{
|
|
type motionSolver;
|
|
|
|
libs ("libfvMeshMovers.so" "librigidBodyMeshMotion.so");
|
|
|
|
motionSolver rigidBodyMotion;
|
|
|
|
rigidBodyMotionCoeffs
|
|
{
|
|
report on;
|
|
|
|
solver
|
|
{
|
|
type Newmark;
|
|
}
|
|
|
|
accelerationRelaxation 0.7;
|
|
|
|
bodies
|
|
{
|
|
floatingObject
|
|
{
|
|
type cuboid;
|
|
parent root;
|
|
|
|
// 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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
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;
|
|
}
|
|
|
|
|
|
distributor
|
|
{
|
|
type distributor;
|
|
|
|
libs ("libfvMeshDistributors.so");
|
|
|
|
redistributionInterval 10;
|
|
}
|
|
|
|
|
|
// ************************************************************************* //
|