Commit a6d734f5 authored by mark's avatar mark

General update on dictionaries and tutorials

parent 108fffe3
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// So we get a decent warning if we have multiple functionObject entries
// with the same name.
#inputMode error;
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.5;
deltaT 0.005;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
functions
{
adiosData
{
// Write solution (Eulerian, Lagrangian) into ADIOS container
type adiosWrite;
// -> normally use #include <-
/// #include "adiosDict";
functionObjectLibs ("libIOadiosWrite.so");
write
{
// Only use explicitly named fields/clouds.
// Otherwise select all fields/clouds that have AUTO_WRITE on.
explicit true; // default = false
// Volume fields
fields ( U p );
// Clouds
clouds ( kinematicCloud );
// Additional cloud attributes to write. Choices:
// - Us = Slip velocity Us = U - Uc
cloudAttrs ( Us );
}
// Output write method: 'adios_config -m' to see available methods
// = MPI (default)
// = MPI_AGGREGATE
// = POSIX
writeMethod MPI;
// Parameters for the selected write method
// = "" (default)
// = "verbose=4;num_aggregators=2;num_ost=2" ...
writeOptions "verbose=4"
// Write interval (in number of iterations)
writeInterval 20;
}
}
// ************************************************************************* //
#!/bin/sh
# helper functions for ADIOS cases
#
# Copy files, adjust system/controlDict for ADIOS
#
copyAdiosFiles()
{
for file in adios adiosOptions
do
if [ -f system.adios/$file -a ! -f system/$file ]
then
\cp -v system.adios/$file system/$file
fi
done
# system/controlDict needs adios function object
grep -qe '#include.*adios' system/controlDict || {
echo "add functions entry for adios"
cat << 'FUNCTIONS' >> system/controlDict
functions
{
#include "adios"
}
// ************************************************************************* //
FUNCTIONS
}
}
#
# Dump last ADIOS file stats to terminal
#
listLastBp()
{
bpfile=$(/bin/ls -tr adiosData | tail -1)
[ -f "adiosData/$bpfile" ] || {
echo "No adios file found in adiosData/"
return
}
echo
ls -ltr adiosData
echo
echo "## Content of last file: $bpfile ##"
echo
bpls "adiosData/$bpfile"
}
# -----------------------------------------------------------------------------
// add ADIOS function-object to system/controlDict
functions
{
#include "adios"
}
// Control for the ADIOS functionObject (OpenFOAM, -*-C++-*-)
adios
{
type adiosWrite;
functionObjectLibs ("libIOadiosWrite.so");
#include "adiosOptions"
// can also have options here:
ignore
{
// clouds to ignore
clouds ( "referr.*" );
}
// Parameters for the selected write method
writeOptions "verbose=4";
// Write interval (in number of iterations)
writeInterval 5;
// Restart with output time not set (do not use if no restart needed)
// e.g. 1.725 will look for adiosData/1.725.bp for checkpoint data
// restartTime 0.0005;
}
......@@ -12,7 +12,7 @@ FoamFile
class dictionary;
location "system";
note "control parameters for adios";
object adiosDict;
object adiosOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
#!/bin/bash
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Remove decomposition subdirs
rm -rf processor*
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
# Remove log files
rm output/*
# Clear any reconstructed results
#foamCleanTutorials
# Clean case
cleanCase
# And delete mesh
foamCleanPolyMesh
# delete ADIOS output
rm -rf adiosData
\rm -rf adiosData
#------------------------------------------------------------------------------
#!/bin/bash
#!/bin/sh
# Create dir for output
if [ ! -d output ]; then
mkdir output
fi
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Create base mesh and decompose
blockMesh > output/1-blockMesh.log 2>&1
decomposePar -force > output/2-decomposePar.log 2>&1
runApplication blockMesh
runApplication decomposePar -force
# Run analysis
mpirun -np 4 icoFoam -parallel 2>&1 | tee output/3-icoFoam.log
runParallel icoFoam
# -----------------------------------------------------------------------------
adios
{
// Write solution (Eulerian, Lagrangian) into ADIOS container
type adiosWrite;
functionObjectLibs ( "libIOadiosWrite.so" );
#include "adiosOptions"
// Additional fields (eg, from other function objects)
write
{
fields ( Lambda2 Q vorticity pMean pPrime2Mean );
}
// Write interval (in number of iterations)
writeInterval 5;
// Restart with output time not step (do not use if no restart needed)
// e.g. 1.725 will look for adiosData/1.725.bp for checkpoint data
// restartTime 0.5;
}
......@@ -12,7 +12,7 @@ FoamFile
class dictionary;
location "system";
note "control parameters for adios";
object adiosDict;
object adiosOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
adios
{
// Write solution (Eulerian, Lagrangian) into ADIOS container
type adiosWrite;
functionObjectLibs ( "libIOadiosWrite.so" );
#include "adiosOptions"
// Additional fields (eg, from other function objects)
write
{
fields ( Lambda2 Q vorticity pMean pPrime2Mean );
}
// Write interval (in number of iterations)
writeInterval 5;
// Restart with output time not step (do not use if no restart needed)
// e.g. 1.725 will look for adiosData/1.725.bp for checkpoint data
// restartTime 0.5;
}
......@@ -12,7 +12,7 @@ FoamFile
class dictionary;
location "system";
note "control parameters for adios";
object adiosDict;
object adiosOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
......
......@@ -47,22 +47,21 @@ runTimeModifiable false;
functions
{
fieldAverage1
{
type fieldAverage;
functionObjectLibs ( "libfieldFunctionObjects.so" );
enabled true;
outputControl outputTime;
fields
(
p
{
mean on;
prime2Mean on;
base time;
}
);
fieldAverage1
{
type fieldAverage;
functionObjectLibs ( "libfieldFunctionObjects.so" );
enabled true;
outputControl outputTime;
fields
(
p
{
mean on;
prime2Mean on;
base time;
}
);
}
Lambda2
......@@ -89,26 +88,7 @@ functions
outputControl outputTime;
}
adiosData
{
// Write solution (Eulerian, Lagrangian) into ADIOS container
type adiosWrite;
#include "adiosDict";
functionObjectLibs ( "libIOadiosWrite.so" );
// Additional fields (eg, from other function objects)
write
{
fields ( Lambda2 Q vorticity pMean pPrime2Mean );
}
// Write interval (in number of iterations)
writeInterval 5;
// Restart with output time not step (do not use if no restart needed)
// e.g. 1.725 will look for adiosData/1.725.bp for checkpoint data
// restartTime 0.5;
}
#include "adios"
}
// ************************************************************************* //
......@@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
......@@ -34,15 +34,12 @@ divSchemes
laplacianSchemes
{
default none;
laplacian(nu,U) Gauss linear orthogonal;
laplacian((1|A(U)),p) Gauss linear orthogonal;
default Gauss linear orthogonal;
}
interpolationSchemes
{
default linear;
interpolate(HbyA) linear;
}
snGradSchemes
......@@ -50,11 +47,5 @@ snGradSchemes
default orthogonal;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //
......@@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
......@@ -22,13 +22,19 @@ solvers
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.05;
}
pFinal
{
$p;
relTol 0;
}
U
{
solver PBiCG;
preconditioner DILU;
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-05;
relTol 0;
}
......
#!/bin/bash
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Copy base case
[ -d system ] || cp -r $FOAM_TUTORIALS/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperInitialState/* ./
# system/adiosDict
[ -f system/adiosDict ] || cp adiosDict system/adiosDict
# system/controlDict needs adios function object
grep "libIOadiosWrite.so" system/controlDict > /dev/null 2>&1 || cat functionObjects >> system/controlDict
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
#
# Copy files, adjust system/controlDict for ADIOS
#
copyAdiosFiles()
{
for file in adios adiosOptions
do
if [ -f system.adios/$file -a ! -f system/$file ]
then
\cp -v system.adios/$file system/$file
fi
done
# system/controlDict needs adios function object
grep -qe '#include.*adios' system/controlDict || {
echo "add functions entry for adios"
cat << 'FUNCTIONS' >> system/controlDict
functions
{
#include "adios"
}
// ************************************************************************* //
FUNCTIONS
}
}
#
# Dump last ADIOS file stats to terminal
#
listLastBp()
{
bpfile=$(/bin/ls -tr adiosData | tail -1)
[ -f "adiosData/$bpfile" ] || {
echo "No adios file found in adiosData/"
return
}
echo
ls -ltr adiosData
echo
echo "## Content of last file: $bpfile ##"
echo
bpls "adiosData/$bpfile"
}
# -----------------------------------------------------------------------------
copyAdiosFiles
# Mesh and run simulation
runApplication blockMesh
runApplication decomposePar
runParallel `getApplication`
runParallel $(getApplication)
# Dump last ADIOS file stats to terminal
echo -e "\n\n"
ls -ltr adiosData
echo -e "\n\n"
f=`ls -tr adiosData | tail -1`
echo "-- List content of the last file: ${f}"
bpls adiosData/${f}
listLastBp
# -----------------------------------------------------------------------------
functions
{
adiosData
{
// Write solution (Eulerian, Lagrangian) into ADIOS container
type adiosWrite;
#include "adiosDict";
functionObjectLibs ("libIOadiosWrite.so");
ignore
{
// clouds to ignore
clouds ( "referr.*" );
}
// Parameters for the selected write method
writeOptions "verbose=4";
// Write interval (in number of iterations)
writeInterval 5;
// Restart with output time not set (do not use if no restart needed)
// e.g. 1.725 will look for adiosData/1.725.bp for checkpoint data
// restartTime 0.0005;
}
}
// ************************************************************************* //
// Control for the ADIOS functionObject (OpenFOAM, -*-C++-*-)
adios
{
type adiosWrite;
functionObjectLibs ("libIOadiosWrite.so");
#include "adiosOptions";
// can also have options here:
ignore
{
// clouds to ignore
clouds ( "referr.*" );
}
// Parameters for the selected write method
writeOptions "verbose=4";
// Write interval (in number of iterations)
writeInterval 5;
// Restart with output time not set (do not use if no restart needed)
// e.g. 1.725 will look for adiosData/1.725.bp for checkpoint data
// restartTime 0.0005;
}
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
note "control parameters for adios";
object adiosOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Output write method: 'adios_config -m' to see available methods
// = MPI (default)
// = MPI_AGGREGATE
// = POSIX
writeMethod MPI;
// Parameters for the selected write method
// = "" (default)
// = "verbose=4;num_aggregators=2;num_ost=2" ...
writeOptions "";
// Additional items to write, or items to write (when explicit)
write
{
// Only use explicitly named fields/clouds.
// Otherwise select all fields/clouds that have AUTO_WRITE on.
explicit false;
// Volume fields
fields ();
// Kinematic clouds
clouds ();
// Additional cloud attributes to write. Choices:
// - Us = Slip velocity Us = U - Uc
cloudAttrs ();
}
// Items to suppress from writing
ignore
{
fields ();
clouds ();
// Future? -> regions ();
}
// Per-region specification - mandatory if "explicit" is true
/*
regions
{
region0
{
write
{
fields ();
clouds ();
cloudAttrs ();
}
ignore
{
fields ();
clouds ();
}
}
}
*/
// ************************************************************************* //
......@@ -12,7 +12,7 @@ FoamFile
class dictionary;
location "system";
note "control parameters for adios";
object adiosDict;
object adiosOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -49,32 +49,9 @@ profiling
{}
// ************************************************************************* //
functions
{
adiosData
{
// Write solution (Eulerian, Lagrangian) into an ADIOS container
type adiosWrite;
#include "adiosDict";
functionObjectLibs ("libIOadiosWrite.so");
ignore
{
// clouds to ignore
clouds ( "referr.*" );
}
// Parameters for the selected write method
/// writeOptions "verbose=4";
// Write interval (in number of iterations)
writeInterval 5;
// Restart with output time not set (do not use if no restart needed)
// e.g. 1.725 will look for adiosData/1.725.bp for checkpoint data
// restartTime 0.0005;
}
#include "adios"
}
// ************************************************************************* //
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment