Moved tutorials/IO -> test/IO

The tutorials/IO/fileHandler case is a set of simple test for fileHandler not a
tutorial
This commit is contained in:
Henry Weller
2021-07-06 14:46:15 +01:00
parent 163eb1c0ef
commit 013bc08399
13 changed files with 2 additions and 2 deletions

37
test/IO/fileHandler/0/U Normal file
View File

@ -0,0 +1,37 @@
/*--------------------------------*- 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 volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
outlet
{
type zeroGradient;
value uniform (0 0 0);
}
walls
{
type noSlip;
}
frontAndBack
{
type noSlip;
}
}
// ************************************************************************* //

11
test/IO/fileHandler/Allclean Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
rm -rf machineA
rm -rf machineB
#------------------------------------------------------------------------------

97
test/IO/fileHandler/Allrun Executable file
View File

@ -0,0 +1,97 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
application=$(getApplication)
runApplication blockMesh
#- Test writing collated format
runApplication decomposePar -fileHandler collated
runParallel $application -fileHandler collated
runApplication reconstructPar -latestTime -fileHandler collated
#- Test writing uncollated format
runApplication -s uncollated decomposePar -fileHandler uncollated -force
runParallel -s uncollated $application -fileHandler uncollated
#- Test uncollated+distributed running: copy to different roots
rm -rf machineA/fileHandler
mkdir -p machineA/fileHandler
( cd machineA/fileHandler && \
cp -r ../../processor[0-1] . && \
cp -r ../../system . && \
mkdir -p constant && find ../../constant -type f -exec cp {} constant/ \;
)
#- Note: slave node does not need constant&system since these are global
rm -rf machineB/fileHandler
mkdir -p machineB/fileHandler
( cd machineB/fileHandler && \
cp -r ../../processor[2-3] .
)
#- Run with different roots
( d=$PWD && \
cd machineA/fileHandler && \
runParallel -s multiRoot $application \
-fileHandler masterUncollated -ioRanks '(0 2)' \
-roots "(\"$d/machineA\" \"$d/machineB\" \"$d/machineB\")"
)
#- Restart from uncollated
runParallel -s collated $application -fileHandler collated
runApplication -s collated reconstructPar -latestTime -fileHandler collated
#- Convert the parallel format to uncollated
runParallel foamFormatConvert -fileHandler uncollated
#- Restart with multiple IO ranks
runParallel -s multiCollated \
$application -fileHandler collated -ioRanks '(0 2)'
#- Reconstruct the multi-rank format. Delete the collated directory
# since conflicts with the multi-collated directory
rm -rf processors4
runApplication -s multiCollated reconstructPar -latestTime \
-fileHandler collated -ioRanks '(0 2)'
#- Convert the multi-rank format to uncollated
runParallel -s uncollated foamFormatConvert -fileHandler uncollated
#- Restart from multiCollated using collated
runParallel -s uncollated_from_multiCollated \
$application -fileHandler uncollated
#- Test collated+distributed running: copy to different roots
# Important: make sure to copy uniform since we're copying it
#- Delete all processor directories
runApplication -s collated decomposePar \
-fileHandler collated -force -copyUniform
rm -rf machineA/fileHandler
mkdir -p machineA/fileHandler
( cd machineA/fileHandler && \
cp -r ../../processor* . && \
cp -r ../../system . && \
mkdir -p constant && find ../../constant -type f -exec cp {} constant/ \;
)
#- Note: slave node does not need constant&system since these are global
rm -rf machineB/fileHandler
mkdir -p machineB/fileHandler
#- Run with different roots
( d=$PWD && \
cd machineA/fileHandler && \
runParallel -s distributed_multiCollated $application \
-fileHandler collated -ioRanks '(0 2)' \
-roots "(\"$d/machineA\" \"$d/machineB\" \"$d/machineB\")"
)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,91 @@
/*--------------------------------*- 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 vectorField;
object cloudPositions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
(
(0.286 0.077 0.0032)
(0.286 0.083 0.0032)
(0.286 0.089 0.0032)
(0.286 0.095 0.0032)
(0.286 0.101 0.0032)
(0.286 0.107 0.0032)
(0.286 0.113 0.0032)
(0.286 0.119 0.0032)
(0.286 0.125 0.0032)
(0.286 0.131 0.0032)
(0.286 0.137 0.0032)
(0.286 0.143 0.0032)
(0.286 0.149 0.0032)
(0.286 0.155 0.0032)
(0.286 0.161 0.0032)
(0.286 0.167 0.0032)
(0.286 0.173 0.0032)
(0.286 0.179 0.0032)
(0.286 0.185 0.0032)
(0.286 0.191 0.0032)
(0.286 0.197 0.0032)
(0.286 0.203 0.0032)
(0.286 0.209 0.0032)
(0.286 0.215 0.0032)
(0.286 0.221 0.0032)
(0.286 0.227 0.0032)
(0.286 0.233 0.0032)
(0.286 0.239 0.0032)
(0.286 0.245 0.0032)
(0.286 0.251 0.0032)
(0.286 0.257 0.0032)
(0.286 0.263 0.0032)
(0.286 0.269 0.0032)
(0.286 0.275 0.0032)
(0.286 0.281 0.0032)
(0.286 0.287 0.0032)
(0.286 0.293 0.0032)
(0.286 0.299 0.0032)
(0.286 0.305 0.0032)
(0.286 0.311 0.0032)
(0.286 0.317 0.0032)
(0.286 0.323 0.0032)
(0.286 0.329 0.0032)
(0.286 0.335 0.0032)
(0.286 0.341 0.0032)
(0.286 0.347 0.0032)
(0.286 0.353 0.0032)
(0.286 0.359 0.0032)
(0.286 0.365 0.0032)
(0.286 0.371 0.0032)
(0.286 0.377 0.0032)
(0.286 0.383 0.0032)
(0.286 0.389 0.0032)
(0.286 0.395 0.0032)
(0.286 0.401 0.0032)
(0.286 0.407 0.0032)
(0.286 0.413 0.0032)
(0.286 0.419 0.0032)
(0.286 0.425 0.0032)
(0.286 0.431 0.0032)
(0.286 0.437 0.0032)
(0.286 0.443 0.0032)
(0.286 0.449 0.0032)
(0.286 0.455 0.0032)
(0.286 0.461 0.0032)
(0.286 0.467 0.0032)
(0.286 0.473 0.0032)
(0.286 0.479 0.0032)
(0.286 0.485 0.0032)
(0.286 0.491 0.0032)
(0.286 0.497 0.0032)
)
// ************************************************************************* //

View File

@ -0,0 +1,138 @@
/*--------------------------------*- 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 cloudProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
type cloud;
solution
{
coupled false;
transient yes;
cellValueSourceCorrection off;
maxCo 0.3;
interpolationSchemes
{
rho cell;
U cellPoint;
mu cell;
}
integrationSchemes
{
U Euler;
}
}
constantProperties
{
rho0 964;
youngsModulus 6e8;
poissonsRatio 0.35;
}
subModels
{
particleForces
{
sphereDrag;
gravity;
}
injectionModels
{
model1
{
type manualInjection;
massTotal 0;
parcelBasisType fixed;
nParticle 1;
SOI 0;
positionsFile "cloudPositions";
U0 (0 0 0);
sizeDistribution
{
type fixedValue;
fixedValueDistribution
{
value 0.006;
}
}
}
}
dispersionModel none;
patchInteractionModel none;
surfaceFilmModel none;
stochasticCollisionModel none;
collisionModel pairCollision;
pairCollisionCoeffs
{
// Maximum possible particle diameter expected at any time
maxInteractionDistance 0.006;
writeReferredParticleCloud no;
pairModel pairSpringSliderDashpot;
pairSpringSliderDashpotCoeffs
{
useEquivalentSize no;
alpha 0.12;
b 1.5;
mu 0.52;
cohesionEnergyDensity 0;
collisionResolutionSteps 12;
};
wallModel wallLocalSpringSliderDashpot;
wallLocalSpringSliderDashpotCoeffs
{
useEquivalentSize no;
collisionResolutionSteps 12;
walls
{
youngsModulus 1e10;
poissonsRatio 0.23;
alpha 0.12;
b 1.5;
mu 0.43;
cohesionEnergyDensity 0;
}
frontAndBack
{
youngsModulus 1e10;
poissonsRatio 0.23;
alpha 0.12;
b 1.5;
mu 0.1;
cohesionEnergyDensity 0;
}
};
}
}
cloudFunctions
{}
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- 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 uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 -9.81 0);
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- 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 momentumTransport;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
/*--------------------------------*- 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 transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
rhoInf [1 -3 0 0 0 0 0] 1.2;
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1e-05;
// ************************************************************************* //

View File

@ -0,0 +1,71 @@
/*--------------------------------*- 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 blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.001;
vertices
(
(0 77.9423 6.2)
(135 0 6.2)
(165 0 6.2)
(300 77.9423 6.2)
(300 500 6.2)
(0 500 6.2)
(0 77.9423 0)
(135 0 0)
(165 0 0)
(300 77.9423 0)
(300 500 0)
(0 500 0)
);
blocks
(
hex (6 9 10 11 0 3 4 5 ) (20 40 1) simpleGrading (1 1 1)
hex (7 8 9 6 1 2 3 0) (20 8 1) simpleGrading (1 1 1)
);
boundary
(
walls
{
type wall;
faces
(
(1 7 8 2)
(0 6 7 1)
(2 8 9 3)
(0 5 11 6)
(3 4 10 9)
(4 10 11 5)
);
}
frontAndBack
{
type wall;
faces
(
(0 3 4 5)
(1 2 3 0)
(6 11 10 9)
(6 9 8 7)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- 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 "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application particleFoam;
startFrom latestTime;
startTime 0;
stopAt writeNow;
endTime 0.25;
deltaT 5e-5;
writeControl runTime;
writeInterval 0.05;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- 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 "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method simple;
simpleCoeffs
{
n (4 1 1);
}
hierarchicalCoeffs
{
n (4 1 1);
order xyz;
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- 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 "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default none;
}
gradSchemes
{
default none;
}
divSchemes
{
default none;
}
laplacianSchemes
{
default none;
}
interpolationSchemes
{
default linear;
}
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- 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 "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
}
// ************************************************************************* //