OpenFOAM field reading: Automated the handling of <field>.orig files

Now if a <field> file does not exist first the compressed <field>.gz file is
searched for and if that also does not exist the <field>.orig file is searched
for.

This simplifies case setup and run scripts as now setField for example can read
the <field>.orig file directly and generate the <field> file from it which is
then read by the solver.  Additionally the cleanCase function used by
foamCleanCase and the Allclean scripts automatically removed <field> files if
there is a corresponding <field>.orig file.  So now there is no need for the
Allrun scripts to copy <field>.orig files into <field> or for the Allclean
scripts to explicitly remove them.
This commit is contained in:
Henry Weller
2018-02-14 17:42:14 +00:00
parent 019c2c08dc
commit df6e2da2dd
82 changed files with 31 additions and 95562 deletions

View File

@ -7,7 +7,6 @@ cd ${0%/*} || exit 1 # Run from this directory
application=`getApplication`
runApplication blockMesh
cp 0/alpha.water.orig 0/alpha.water
runApplication setFields
runApplication $application

View File

@ -1,51 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
leftWall
{
type zeroGradient;
}
rightWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -5,6 +5,5 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
cp 0/alpha.water.orig 0/alpha.water
#------------------------------------------------------------------------------

View File

@ -37,7 +37,7 @@ writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
writeCompression compressed;
timeFormat general;

View File

@ -1,41 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
walls
{
type zeroGradient;
}
obstacle
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -7,7 +7,6 @@ cd ${0%/*} || exit 1 # Run from this directory
application=`getApplication`
runApplication ./makeMesh
cp 0/alpha.water.orig 0/alpha.water
runApplication setFields
runApplication $application

View File

@ -6,7 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication blockMesh
runApplication snappyHexMesh -overwrite
cp 0/alpha.water.orig 0/alpha.water
runApplication setFields
runApplication `getApplication`

View File

@ -6,7 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory
m4 system/blockMeshDict.m4 > system/blockMeshDict
runApplication blockMesh
cp 0/alpha.water.orig 0/alpha.water
runApplication setFields
runApplication `getApplication`

View File

@ -6,7 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory
m4 system/blockMeshDict.m4 > system/blockMeshDict
runApplication blockMesh
cp 0/alpha.water.orig 0/alpha.water
runApplication setFields
runApplication `getApplication`

View File

@ -6,7 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory
m4 system/blockMeshDict.m4 > system/blockMeshDict
runApplication blockMesh
cp 0/alpha.water.orig 0/alpha.water
runApplication setFields
runApplication `getApplication`

View File

@ -6,7 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory
m4 system/blockMeshDict.m4 > system/blockMeshDict
runApplication blockMesh
cp 0/alpha.water.orig 0/alpha.water
runApplication setFields
runApplication `getApplication`

View File

@ -6,7 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory
m4 system/blockMeshDict.m4 > system/blockMeshDict
runApplication blockMesh
cp 0/alpha.water.orig 0/alpha.water
runApplication setFields
runApplication `getApplication`

View File

@ -5,7 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
cp 0/alpha.water.orig 0/alpha.water
runApplication setFields
runApplication `getApplication`