BUG: regression in handling of finiteArea processor boundaries (#2507)

- update the area-centres processor/processor information as part of
  faMesh::init() after all of the global data and geometry data is
  setup.

- improve flattenEdgeField helper to properly handle empty patches.
  This change removes the false fails when testing edge-centre
  redistribution (FULLDEBUG mode).

TUT: add filmPanel (rivulet) tutorial
This commit is contained in:
Mark Olesen
2022-06-08 17:18:15 +02:00
parent 7f748bd5fd
commit 8efa44734a
25 changed files with 1094 additions and 64 deletions

View File

@ -0,0 +1,98 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Ux 0;
Uy 0;
Uz 0;
CON 100;
Uinlet uniform ($Ux $Uy $Uz);
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
"(inlet|outlet)"
{
type fixedValue;
value $Uinlet;
}
"(side|back)"
{
//type zeroGradient;
type fixedValue;
value $Uinlet;
}
film
{
type velocityFilmShell;
active true;
U U;
pRef 1e5;
T0 313.15;;
deltaWet 5e-5; // dry vs wet
thermo
{
H2O;
}
turbulence laminar;
laminarCoeffs
{
shearStress simple;
friction quadraticProfile; //
//n 0.03;// Manning number
Cf 0; //1e-18;//0.001;//0.9;
// Gas/liquid/surface friction for DarcyWeisbach 0.0
// the friction is with the wall
}
injectionModels ();
forces (perturbedTemperatureDependentContactAngle);
perturbedTemperatureDependentContactAngleCoeffs
{
Ccf 0.4;
theta constant 0;
distribution
{
type normal;
normalDistribution
{
minValue $CON;
maxValue $CON;
mu $CON;
sigma 100;
}
}
}
region film;
liquidFilmModel kinematicThinFilm;
value uniform (0 0 0);
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class areaVectorField;
location "0";
object Uf_film;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Uin 0.309;
// To fix original position, no rotate, gravity is modified
// alphaPlateFix 90;
// Uin_y #eval{ - $Uin*sin(degToRad($alphaPlateFix)) };
// Uin_z #eval{ $Uin*cos(degToRad($alphaPlateFix)) };
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0 #eval{ -$Uin } 0);
}
outlet
{
type zeroGradient;
}
side
{
//type fixedValue;
//value $internalField;
type slip;
value $internalField;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class areaScalarField;
location "0";
object h_film;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type fixedValue;
value uniform 1e-3;
}
outlet
{
type zeroGradient;
}
side
{
type inletOutlet;
inletValue $internalField;
value $internalField;
phi phi2s_film;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,43 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
"(outlet|side|back)"
{
type fixedValue;
value uniform 0;
}
film
{
type zeroGradient;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
#------------------------------------------------------------------------------

View File

@ -0,0 +1,33 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
decompDict="-decomposeParDict system/decomposeParDict.4"
if false
then
# Simple preparation
runApplication makeFaMesh
runApplication decomposePar
else
# Additional steps (to exercise some functionality)
runParallel $decompDict -s decompose redistributePar -decompose
runParallel $decompDict makeFaMesh
runParallel -s redistribute redistributePar -overwrite
fi
runParallel $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
alpha 5;
alphax 0;
dimensions [0 1 -2 0 0 0 0];
value #eval
{
-9.81 * vector
(
sin(degToRad($alphax)),
sin(degToRad($alpha)),
cos(degToRad($alpha))
)
};
// ************************************************************************* //

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu 1e-5;
rhoInf 1.2;
// ************************************************************************* //

View File

@ -0,0 +1,19 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,118 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
xside 0.05;
xcore 0.51;
ymax 1.22;
zmin -0.01;
cellWidth 0.005;
//cellWidth 0.01;
nx #eval{ round($xside / $cellWidth) };
nxin #eval{ round($xcore / $cellWidth) };
ny #eval{ round($ymax / $cellWidth) };
nz 1;
vertices
(
// side
(0 0 $zmin)
($xside 0 $zmin)
($xside $ymax $zmin)
(0 $ymax $zmin)
(0 0 0)
($xside 0 0)
($xside $ymax 0)
(0 $ymax 0)
// central core
(#eval{$xcore + $xside} 0 $zmin)
(#eval{$xcore + $xside} $ymax $zmin)
(#eval{$xcore + $xside} 0 0)
(#eval{$xcore + $xside} $ymax 0)
// side
(#eval{$xcore + 2*$xside} 0 $zmin)
(#eval{$xcore + 2*$xside} $ymax $zmin)
(#eval{$xcore + 2*$xside} 0 0)
(#eval{$xcore + 2*$xside} $ymax 0)
);
blocks
(
hex (0 1 2 3 4 5 6 7 ) ($nx $ny $nz) grading (1 1 1)
hex (1 8 9 2 5 10 11 6 ) ($nxin $ny $nz) grading (1 1 1)
hex (8 12 13 9 10 14 15 11) ($nx $ny $nz) grading (1 1 1)
);
boundary
(
inlet
{
type patch;
faces
(
(2 9 11 6)
);
}
outlet
{
type patch;
faces
(
(0 1 5 4)
(1 8 10 5)
(8 12 14 10)
);
}
side
{
type patch;
faces
(
(0 3 7 4)
(12 14 15 13)
(3 2 6 7)
(9 13 15 11)
);
}
back
{
type patch;
faces
(
(4 5 6 7)
(5 10 11 6)
(10 14 15 11)
);
}
film
{
type patch;
faces
(
(0 1 2 3)
(1 8 9 2)
(8 12 13 9)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,69 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//libs (regionFaModels);
application pimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 5;
deltaT 0.0005;
writeControl timeStep;
writeInterval 400;
purgeWrite 0;
writeFormat binary; // ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep no;
maxCo 1;
maxDeltaT 0.1;
functions
{
#include "sampling"
residuals
{
type solverInfo;
libs (utilityFunctionObjects);
fields (".*");
}
}
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 12;
method scotch;
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 16;
method scotch;
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
method scotch;
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant/faMesh";
object faMeshDefinition;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
polyMeshPatches ( film );
boundary
{
inlet
{
type patch;
neighbourPolyPatch inlet;
}
outlet
{
type patch;
neighbourPolyPatch outlet;
}
side
{
type patch;
neighbourPolyPatch side;
}
}
// ************************************************************************** //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object faSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phif_film,hf_film) Gauss upwind;//Gamma 0.5;
div(phi2s_film,Uf_film) Gauss upwind;
}
laplacianSchemes
{
default none;
laplacian(hf_film) Gauss linear limited 0.33;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default limited 0.33;
}
fluxRequired
{
hf_film true;
}
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object faSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
Uf_film
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-08;
relTol 0.0;
}
hf_film
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-08;
relTol 0.0;
}
}
PIMPLE
{
momentumPredictor true;
nOuterCorr 4;
nCorr 1;
nNonOrthCorr 0;
nFilmCorr 1;
}
relaxationFactors
{
hf_Film 0.9;
Uf_Film 0.9;
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss linearUpwind grad(U);
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
interpolate(HbyA) linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,87 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"pcorr.*"
{
solver GAMG;
smoother GaussSeidel;
cacheAgglomeration no;
tolerance 0.02;
relTol 0;
}
p
{
$pcorr;
tolerance 1e-06;
relTol 0.01;
}
pFinal
{
$p;
tolerance 1e-06;
relTol 0;
}
U
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-05;
relTol 0.01;
}
UFinal
{
$U;
tolerance 1e-06;
relTol 0;
}
cellMotionUx
{
solver PCG;
preconditioner DIC;
tolerance 1e-08;
relTol 0;
}
}
PIMPLE
{
correctPhi no;
nOuterCorrectors 1;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
relaxationFactors
{
equations
{
"U.*" 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,73 @@
// -*- C++ -*-
probes
{
type probes;
libs (sampling);
writeControl timeStep;
writeInterval 2;
probeLocations
(
(0.305 0.02 -0.01)
(0.305 0.27 -0.01)
(0.305 0.52 -0.01)
(0.305 0.77 -0.01)
(0.305 1.02 -0.01)
(0.305 1.21 -0.01)
);
fixedLocations false;
fields
(
p U
);
}
patch
{
enabled false;
type surfaces;
libs (sampling);
surfaceFormat boundaryData;
writeControl adjustableRunTime;
writeInterval 0.1;
interpolationScheme cell;
surfaceFormat vtk;
fields (U p hf_film ); // ( alpha.water p U k omega);
surfaces
{
film
{
type patch;
patches ("film.*");
interpolate true;
}
}
}
area
{
type areaWrite;
libs (utilityFunctionObjects);
// Write at same frequency as fields
writeControl outputTime;
writeInterval 1;
fields (U p hf_film );
surfaceFormat ensight;
formatOptions
{
ensight
{
format binary;
}
}
}
// ************************************************************************* //