Merge branch 'feature-anisotropic-solid-material-conductivity' into 'develop'

ENH: new tabulated anisotropic solid transport model

See merge request Development/openfoam!546
This commit is contained in:
Mattijs Janssens
2022-06-08 12:59:50 +00:00
606 changed files with 2806 additions and 1559 deletions

View File

@ -75,17 +75,17 @@ Usage
c0 330;
// Input - either points or surface
// Input - either point or surface
input points;
input point;
observerPositions ((0 0 0)(1 0 0));
//input surface;
//surface "inputSurface.obj"
// Output - either points or surface
output points;
// Output - either point or surface
output point;
//output surface;
//surfaceType ensight;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2021 OpenCFD Ltd.
Copyright (C) 2017-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -480,6 +480,33 @@ namespace Foam
hTabulatedPolyIcoSolidThermoPhysics
);
// From pure phase (tabulated) to solid phase (icoTabulated)
makeInterfacePureType
(
Lee,
heRhoThermo,
rhoThermo,
pureMixture,
tabulatedThermoPhysics,
heSolidThermo,
solidThermo,
pureMixture,
hTabulatedIcoTabulatedSolidThermoPhysics
);
// From solid phase (icoTabulated) to pure phase (tabulated)
makeInterfacePureType
(
Lee,
heSolidThermo,
solidThermo,
pureMixture,
hTabulatedIcoTabulatedSolidThermoPhysics,
heRhoThermo,
rhoThermo,
pureMixture,
tabulatedThermoPhysics
);
// interfaceHeatResistance model definitions

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -37,6 +38,7 @@ Description
#include "specie.H"
#include "rhoConst.H"
#include "icoPolynomial.H"
#include "icoTabulated.H"
#include "hConstThermo.H"
#include "hPolynomialThermo.H"
#include "hPowerThermo.H"
@ -136,6 +138,19 @@ namespace Foam
sensibleEnthalpy
>
> hTabulatedPolyIcoSolidThermoPhysics;
typedef
tabulatedSolidTransport
<
species::thermo
<
hTabulatedThermo
<
icoTabulated<specie>
>,
sensibleEnthalpy
>
> hTabulatedIcoTabulatedSolidThermoPhysics;
}

View File

@ -0,0 +1,77 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "tabulatedAnIsoSolidTransport.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Thermo>
Foam::tabulatedAnIsoSolidTransport<Thermo>::tabulatedAnIsoSolidTransport
(
const dictionary& dict
)
:
Thermo(dict),
kappa_(Function1<vector>::New("kappa", dict.subDict("transport")))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Thermo>
void Foam::tabulatedAnIsoSolidTransport<Thermo>::write(Ostream& os) const
{
os.beginBlock(this->name());
Thermo::write(os);
{
os.beginBlock("transport");
kappa_->writeData(os);
os.endBlock();
}
os.endBlock();
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class Thermo>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const tabulatedAnIsoSolidTransport<Thermo>& pt
)
{
pt.write(os);
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,181 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::tabulatedAnIsoSolidTransport
Description
Transport properties package using \c Function1 type data
for anisotropic thermal conductivity.
Usage
Example of the specification of the transport properties:
\verbatim
transport
{
// kappa <Function1<vector>>;
kappa table
(
// T kappa
( 200 (2.56e-5 2e-5 2e-5) )
( 350 (3.33e-5 1e-5 1e-5) )
( 400 (4.72e-5 3e-5 3-e5) )
);
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Reqd | Deflt
kappa | Thermal conductivity | Function1\<vector\> | yes | -
\endtable
SourceFiles
tabulatedAnIsoSolidTransportI.H
tabulatedAnIsoSolidTransport.C
\*---------------------------------------------------------------------------*/
#ifndef Foam_tabulatedAnIsoSolidTransport_H
#define Foam_tabulatedAnIsoSolidTransport_H
#include "Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward Declarations
template<class Thermo> class tabulatedAnIsoSolidTransport;
template<class Thermo>
Ostream& operator<<(Ostream&, const tabulatedAnIsoSolidTransport<Thermo>&);
/*---------------------------------------------------------------------------*\
Class tabulatedAnIsoSolidTransport Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo>
class tabulatedAnIsoSolidTransport
:
public Thermo
{
// Private Data
//- Thermal conductivity data [W/m/K]
autoPtr<Function1<vector>> kappa_;
// Constructors
//- Construct from components
inline tabulatedAnIsoSolidTransport
(
const Thermo& t,
const autoPtr<Function1<vector>>& kappa
);
public:
// Constructors
//- Construct as named copy
inline tabulatedAnIsoSolidTransport
(
const word&,
const tabulatedAnIsoSolidTransport&
);
//- Construct from dictionary
explicit tabulatedAnIsoSolidTransport(const dictionary& dict);
//- Return a clone
inline autoPtr<tabulatedAnIsoSolidTransport> clone() const;
// Selector from dictionary
inline static autoPtr<tabulatedAnIsoSolidTransport> New
(
const dictionary& dict
);
// Member Functions
//- The instantiated type name
static word typeName()
{
return "tabulatedAnIso<" + Thermo::typeName() + '>';
}
//- Is the thermal conductivity isotropic
static const bool isotropic = false;
//- Dynamic viscosity [kg/m/s]
inline scalar mu(const scalar p, const scalar T) const;
//- Thermal conductivity [W/m/K]
inline scalar kappa(const scalar p, const scalar T) const;
//- Thermal conductivity [W/m/K]
inline vector Kappa(const scalar p, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/m/s]
inline scalar alphah(const scalar p, const scalar T) const;
//- Write to Ostream
void write(Ostream& os) const;
// Ostream Operator
friend Ostream& operator<< <Thermo>
(
Ostream&,
const tabulatedAnIsoSolidTransport&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "tabulatedAnIsoSolidTransportI.H"
#ifdef NoRepository
#include "tabulatedAnIsoSolidTransport.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,120 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "specie.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Thermo>
inline Foam::tabulatedAnIsoSolidTransport<Thermo>::tabulatedAnIsoSolidTransport
(
const Thermo& t,
const autoPtr<Function1<vector>>& kappa
)
:
Thermo(t),
kappa_(kappa.clone())
{}
template<class Thermo>
inline Foam::tabulatedAnIsoSolidTransport<Thermo>::tabulatedAnIsoSolidTransport
(
const word& name,
const tabulatedAnIsoSolidTransport& pt
)
:
Thermo(name, pt),
kappa_(pt.kappa_.clone())
{}
template<class Thermo>
inline Foam::autoPtr<Foam::tabulatedAnIsoSolidTransport<Thermo>>
Foam::tabulatedAnIsoSolidTransport<Thermo>::clone() const
{
return autoPtr<tabulatedAnIsoSolidTransport<Thermo>>::New(*this);
}
template<class Thermo>
inline Foam::autoPtr<Foam::tabulatedAnIsoSolidTransport<Thermo>>
Foam::tabulatedAnIsoSolidTransport<Thermo>::New(const dictionary& dict)
{
return autoPtr<tabulatedAnIsoSolidTransport<Thermo>>::New(dict);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Thermo>
inline Foam::scalar Foam::tabulatedAnIsoSolidTransport<Thermo>::mu
(
const scalar p,
const scalar T
) const
{
NotImplemented;
return 0;
}
template<class Thermo>
inline Foam::scalar Foam::tabulatedAnIsoSolidTransport<Thermo>::kappa
(
const scalar p,
const scalar T
) const
{
return mag(kappa_->value(T));
}
template<class Thermo>
inline Foam::vector Foam::tabulatedAnIsoSolidTransport<Thermo>::Kappa
(
const scalar p,
const scalar T
) const
{
return kappa_->value(T);
}
template<class Thermo>
inline Foam::scalar Foam::tabulatedAnIsoSolidTransport<Thermo>::alphah
(
const scalar p,
const scalar T
) const
{
return kappa(p, T)/this->Cp(p, T);
}
// ************************************************************************* //

View File

@ -33,6 +33,7 @@ License
#include "specie.H"
#include "rhoConst.H"
#include "icoPolynomial.H"
#include "icoTabulated.H"
#include "hConstThermo.H"
#include "hPowerThermo.H"
#include "hPolynomialThermo.H"
@ -42,6 +43,7 @@ License
#include "exponentialSolidTransport.H"
#include "polynomialSolidTransport.H"
#include "tabulatedSolidTransport.H"
#include "tabulatedAnIsoSolidTransport.H"
#include "pureMixture.H"
#include "sensibleEnthalpy.H"
#include "sensibleInternalEnergy.H"
@ -116,6 +118,30 @@ makeSolidThermo
specie
);
makeSolidThermo
(
solidThermo,
heSolidThermo,
pureMixture,
tabulatedSolidTransport,
sensibleEnthalpy,
hTabulatedThermo,
icoTabulated,
specie
);
makeSolidThermo
(
solidThermo,
heSolidThermo,
pureMixture,
tabulatedAnIsoSolidTransport,
sensibleEnthalpy,
hTabulatedThermo,
icoPolynomial,
specie
);
makeSolidThermoPhysicsType
(
solidThermo,

View File

@ -3,12 +3,9 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
rm -rf 0.orig
rm -rf system
rm -rf constant
rm -rf setups
rm -rf results
rm -rf plots
rm -f setups.orig/common/constant/transportProperties
#------------------------------------------------------------------------------

View File

@ -1,10 +1,9 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
# setups
# settings
# operand setups
setups="
@ -12,6 +11,18 @@ cd "${0%/*}" || exit # Run from this directory
LaunderSharmaKE-nutkWallFunction
"
# flag to enable computations
run=true
# flag to enable computations in parallel mode
parallel=false
# flag to enable to use a common mesh
common_mesh=true
# flag to enable to use a common dynamic code
common_dynamic_code=true
# operand exponents of kinematic viscosity values
nuExponents="2 3 4 5 6 7 8"
@ -19,107 +30,163 @@ cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
#######################################
# Collect results into a given path
# and clean the case for the next run
# Create the given setup
# Arguments:
# $1 = Path to move results
# $1 = Path to create the setup
# Outputs:
# Writes info to stdout
#######################################
collect() {
dry_run_setup() {
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
collection="$1"
setup="$1"
exponent="$2"
dirSetup="setups/$setup/$exponent"
dirSetupOrig="setups.orig/$setup"
dirOrig="$dirSetupOrig/0.orig"
dirConstant="$dirSetupOrig/constant"
dirSystem="$dirSetupOrig/system"
dirResult=results/"$collection"
dirSettings="$dirResult"/settings
printf "\n# Create the setup: %s %s\n" "$setup" nu=1e-"$exponent"
if [ ! -d "$dirSetup" ]
then
mkdir -p "$dirSetup"
cp -aRfL "setups.orig/common/." "$dirSetup"
cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || :
[ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig"
[ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant"
[ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system"
else
printf "\n # Directory %s already exists\n" "$dirSetup"
printf " # Skipping the creation of a new setup\n"
fi
}
#######################################
# Run the given setup
# Arguments:
# $1 = Path to the setup to run
# Outputs:
# Writes info to stdout
#######################################
run_setup() {
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
setup="$1"
exponent="$2"
dirSetup="setups/$setup/$exponent"
dirResult="results/$setup/$exponent"
dry_run_setup "$setup" "$exponent"
[ -d results ] || mkdir -p results
[ -d results/"$setup" ] || mkdir -p results/"$setup"
printf "\n# Run the setup: %s %s\n\n" "$setup" nu=1e-"$exponent"
if [ ! -d "$dirResult" ]
then
cp -Rf "$dirSetup" "$dirResult"
echo " # Collecting results and settings into $dirResult"
if [ "$common_mesh" = true ]
then
if [ -d results/mesh ]
then
printf "## Copy the common mesh to the setup: %s\n\n" "$setup"
cp -Rf results/mesh/polyMesh "$dirResult"/constant/.
fi
fi
mkdir -p "$dirResult"
mkdir -p "$dirSettings"
if [ "$common_dynamic_code" = true ]
then
if [ -d results/dynamicCode ]
then
printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup"
cp -Rf results/dynamicCode "$dirResult"/.
fi
fi
mv -f $(foamListTimes) "$dirResult"
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
mv -f log.* "$dirResult"
mv -f graphs/ "$dirResult"
mv -f logs/ "$dirResult"
cp -f system/{fv*,controlDict} constant/*Properties "$dirSettings"
mv -f 0/ "$dirSettings"
echo " # Cleaning up the case"
if [ "$parallel" = true ]
then
( cd "$dirResult" && ./Allrun-parallel )
else
( cd "$dirResult" && ./Allrun )
fi
if [ "$common_mesh" = true ]
then
if [ ! -d results/mesh ]
then
printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup"
mkdir -p results/mesh
cp -Rf "$dirResult"/constant/polyMesh results/mesh/.
fi
fi
if [ "$common_dynamic_code" = true ]
then
if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ]
then
printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup"
cp -Rf "$dirResult"/dynamicCode results/.
fi
fi
cleanTimeDirectories
cleanAuxiliary
cleanPostProcessing
else
echo " # Directory $dirResult already exists"
echo " # Skipping the computation"
printf " # Directory %s already exists\n" "$dirResult"
printf " # Skipping the computation of the given setup\n"
fi
}
#------------------------------------------------------------------------------
for setup in $setups
do
echo ""
echo "# Computations for the setup: $setup"
echo ""
dirSetup="setups.orig/$setup"
cp -rfL "$dirSetup/0.orig" .
cp -rfL "$dirSetup/constant" .
cp -rfL "$dirSetup/system" .
cp -rf 0.orig/ 0/
if [ ! -d constant/polyMesh ]
then
runApplication blockMesh
runApplication renumberMesh -overwrite -constant
runApplication checkMesh -allTopology -allGeometry -constant
fi
echo "# yPlus vs uPlus" > yPlus_vs_uPlus.xy
for exponent in $nuExponents
do
echo " Setting nu to 1e-$exponent"
sed "s|EXPONENT|$exponent|g" constant/transportProperties.template \
> constant/transportProperties
[ -d 0 ] || restore0Dir
runApplication $(getApplication)
runApplication foamLog log.boundaryFoam
if [ -e logs/yPlus_0 ]
then
yPlus=$(awk < logs/yPlus_0 'END{print $2}')
uPlus=$(awk < logs/uPlus_0 'END{print $2}')
echo "$yPlus $uPlus" >> yPlus_vs_uPlus.xy
fi
collect "$setup/$exponent"
done
mv -f yPlus_vs_uPlus.xy results/"$setup"/
done
[ "$parallel" = true ] && {
echo "boundaryFoam has no parallel option - skipping the execution" 1>&2
exit 1
}
#------------------------------------------------------------------------------
for exponent in $nuExponents
do
sed "s|EXPONENT|$exponent|g" \
setups.orig/common/constant/transportProperties.template > \
setups.orig/common/constant/transportProperties
for setup in $setups
do
dirSetupOrig="setups.orig/$setup"
if [ ! -d "$dirSetupOrig" ]
then
echo "Setup directory: $dirSetupOrig" \
"could not be found - skipping execution" 1>&2
continue
fi
if [ "$run" = true ]
then
run_setup "$setup" "$exponent"
else
dry_run_setup "$setup" "$exponent"
fi
done
done
if notTest "$@" && [ "$run" = true ]
then
./plot
fi
#------------------------------------------------------------------------------

View File

@ -10,4 +10,4 @@ Usage:
- run test using Allrun script
- uses foamLog to generate u+ and y+ values
- postscript (.eps) plot generated using gnuplot, OF_vs_ANALYTICAL.eps
- plots are generated using gnuplot, and can be found under plots directory

View File

@ -72,16 +72,19 @@ command -v gnuplot >/dev/null || {
for setup in $setups
do
echo ""
echo "# Plots for the setup: $setup"
echo ""
[ -d "results/$setup" ] || {
echo "No results/$setup directory found - skipping graph creation" 1>&2
continue
}
dirPlots="plots/$setup"
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
plot_yPlus_vs_uPlus "$setup"
done

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,20 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication $(getApplication)
runApplication foamLog log.boundaryFoam
if [ -e logs/yPlus_0 ]
then
yPlus=$(awk < logs/yPlus_0 'END{print $2}')
uPlus=$(awk < logs/uPlus_0 'END{print $2}')
echo "$yPlus $uPlus" >> ../yPlus_vs_uPlus.xy
fi
#------------------------------------------------------------------------------

View File

@ -0,0 +1,19 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
canCompile || exit 0 # Dynamic code
restore0Dir
if [ ! -d constant/polyMesh ]
then
runApplication blockMesh
runApplication renumberMesh -overwrite -constant
runApplication checkMesh -allTopology -allGeometry -constant
fi
#------------------------------------------------------------------------------

View File

@ -3,14 +3,9 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
rm -rf 0.orig
rm -rf system
rm -rf constant
rm -rf setups
rm -rf results
rm -rf plots
rm -f *.dat
( cd validation/WatersKing && wclean WatersKing )

View File

@ -1,10 +1,9 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
# setups
# settings
# operand setups
setups="
@ -12,124 +11,161 @@ cd "${0%/*}" || exit # Run from this directory
Stokes
"
# flag to enable computations
run=true
# flag to enable computations in parallel mode
parallel=true
# flag to enable to use a common mesh
common_mesh=true
# flag to enable to use a common dynamic code
common_dynamic_code=true
#------------------------------------------------------------------------------
#######################################
# Collect results into a given path
# and clean the case for the next run
# Create the given setup
# Arguments:
# $1 = Path to move results
# $1 = Path to create the setup
# Outputs:
# Writes info to stdout
#######################################
collect() {
dry_run_setup() {
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
collection="$1"
setup="$1"
dirSetup="setups/$setup"
dirSetupOrig="setups.orig/$setup"
dirOrig="$dirSetupOrig/0.orig"
dirConstant="$dirSetupOrig/constant"
dirSystem="$dirSetupOrig/system"
dirResult=results/"$collection"
dirSettings="$dirResult"/settings
printf "\n# Create the setup: %s\n" "$setup"
if [ ! -d "$dirResult" ]
if [ ! -d "$dirSetup" ]
then
mkdir -p "$dirSetup"
echo " # Collecting results and settings into $dirResult"
mkdir -p "$dirResult"
mkdir -p "$dirSettings"
mv -f $(foamListTimes) "$dirResult"
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
[ -d processor0 ] && mv -f processor* "$dirResult"
mv -f log.* "$dirResult"
cp -f system/{fv*,controlDict} constant/*Properties "$dirSettings"
mv -f 0/ "$dirSettings"
echo " # Cleaning up the case"
cleanTimeDirectories
cleanAuxiliary
cleanPostProcessing
cp -aRfL "setups.orig/common/." "$dirSetup"
cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || :
[ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig"
[ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant"
[ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system"
else
echo " # Directory $dirResult already exists"
echo " # Skipping the computation"
printf "\n # Directory %s already exists\n" "$dirSetup"
printf " # Skipping the creation of a new setup\n"
fi
}
#------------------------------------------------------------------------------
#######################################
# Run the given setup
# Arguments:
# $1 = Path to the setup to run
# Outputs:
# Writes info to stdout
#######################################
run_setup() {
if ! canCompile
then
echo "skipping tutorial $PWD"
exit 0
fi
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
setup="$1"
dirSetup="setups/$setup"
dirResult="results/$setup"
dry_run_setup "$setup"
[ -d results ] || mkdir -p results
printf "\n# Run the setup: %s\n\n" "$setup"
if [ ! -d "$dirResult" ]
then
cp -Rf "$dirSetup" "$dirResult"
if [ "$common_mesh" = true ]
then
if [ -d results/mesh ]
then
printf "## Copy the common mesh to the setup: %s\n\n" "$setup"
cp -Rf results/mesh/polyMesh "$dirResult"/constant/.
fi
fi
if [ "$common_dynamic_code" = true ]
then
if [ -d results/dynamicCode ]
then
printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup"
cp -Rf results/dynamicCode "$dirResult"/.
fi
fi
if [ "$parallel" = true ]
then
( cd "$dirResult" && ./Allrun-parallel )
else
( cd "$dirResult" && ./Allrun )
fi
if [ "$common_mesh" = true ]
then
if [ ! -d results/mesh ]
then
printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup"
mkdir -p results/mesh
cp -Rf "$dirResult"/constant/polyMesh results/mesh/.
fi
fi
if [ "$common_dynamic_code" = true ]
then
if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ]
then
printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup"
cp -Rf "$dirResult"/dynamicCode results/.
fi
fi
else
printf " # Directory %s already exists\n" "$dirResult"
printf " # Skipping the computation of the given setup\n"
fi
}
#------------------------------------------------------------------------------
for setup in $setups
do
dirSetupOrig="setups.orig/$setup"
echo ""
echo "# Computations for the setup: $setup"
echo ""
dirSetup="setups.orig/$setup"
cp -rfL "$dirSetup/0.orig" .
cp -rfL "$dirSetup/constant" .
cp -rfL "$dirSetup/system" .
cp -rf 0.orig/ 0/
if [ ! -d constant/polyMesh ]
if [ ! -d "$dirSetupOrig" ]
then
runApplication blockMesh
runApplication renumberMesh -overwrite -constant
runApplication checkMesh -allTopology -allGeometry -constant
echo "Setup directory: $dirSetupOrig" \
"could not be found - skipping execution" 1>&2
continue
fi
if [ "$parallel" = true ]
if [ "$run" = true ]
then
runApplication decomposePar
runParallel $(getApplication)
runApplication reconstructPar
run_setup "$setup"
else
runApplication $(getApplication)
dry_run_setup "$setup"
fi
if notTest "$@"
then
# postprocessing
tail -n +4 postProcessing/probes/0/U | \
tr -s " " | tr -d '(' | cut -d " " -f2-3 > \
postProcessing/probes/0/Unp
fi
collect "$setup"
done
( cd validation/WatersKing && wmake )
runApplication WatersKing
if notTest "$@" && [ "$run" = true ]
then
./plot
fi
#------------------------------------------------------------------------------

View File

@ -12,37 +12,21 @@ cd "${0%/*}" || exit # Run from this directory
"
#------------------------------------------------------------------------------
# Requires gnuplot
command -v gnuplot >/dev/null || {
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
exit 1
}
# Check "results" directory
[ -d "results" ] || {
echo "FOAM FATAL ERROR: No results directory found - skipping graph creation" 1>&2
exit 1
}
#------------------------------------------------------------------------------
plot_t_vs_Ux() {
setups=$@
benchmarkFile="WatersKing.dat"
n=0
for setup in $setups
do
benchmarkFile="results/$setup/WatersKing.dat"
sampleFiles[$n]="results/$setup/postProcessing/probes/0/Unp"
n=$(($n+1))
done
endTime=$(foamDictionary system/controlDict -entry endTime -value)
endTime=$(foamDictionary results/$setup/system/controlDict -entry endTime -value)
image="plots/planarPoiseuille.png"
gnuplot<<PLT
@ -70,6 +54,21 @@ PLT
}
#------------------------------------------------------------------------------
# Requires gnuplot
command -v gnuplot >/dev/null || {
echo "gnuplot not found - skipping graph creation" 1>&2
exit 1
}
# Check "results" directory
[ -d "results" ] || {
echo "No results directory found - skipping graph creation" 1>&2
exit 1
}
#------------------------------------------------------------------------------
echo ""

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,22 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication $(getApplication)
if notTest "$@"
then
# postprocessing
tail -n +4 postProcessing/probes/0/U | \
tr -s " " | tr -d '(' | cut -d " " -f2-3 > \
postProcessing/probes/0/Unp
( cd ../../validation/WatersKing && wmake )
runApplication WatersKing
fi
#------------------------------------------------------------------------------

View File

@ -0,0 +1,26 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
runApplication reconstructPar
if notTest "$@"
then
# postprocessing
tail -n +4 postProcessing/probes/0/U | \
tr -s " " | tr -d '(' | cut -d " " -f2-3 > \
postProcessing/probes/0/Unp
( cd ../../validation/WatersKing && wmake )
runApplication WatersKing
fi
#------------------------------------------------------------------------------

View File

@ -0,0 +1,19 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
canCompile || exit 0 # Dynamic code
restore0Dir
if [ ! -d constant/polyMesh ]
then
runApplication blockMesh
runApplication renumberMesh -overwrite -constant
runApplication checkMesh -allTopology -allGeometry -constant
fi
#------------------------------------------------------------------------------

View File

@ -16,20 +16,20 @@ FoamFile
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0.14;
internalField uniform 4e-05;
boundaryField
{
inlet
{
type freestream;
freestreamValue uniform 0.14;
freestreamValue $internalField;
}
outlet
{
type freestream;
freestreamValue uniform 0.14;
freestreamValue $internalField;
}
walls

View File

@ -16,20 +16,20 @@ FoamFile
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0.14;
internalField uniform 1e-05;
boundaryField
{
inlet
{
type freestream;
freestreamValue uniform 0.14;
freestreamValue $internalField;
}
outlet
{
type freestream;
freestreamValue uniform 0.14;
freestreamValue $internalField;
}
walls

View File

@ -3,8 +3,8 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
rm -rf *.png
rm -rf setups
rm -rf results
rm -rf plots
#------------------------------------------------------------------------------

View File

@ -1,7 +1,6 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
# settings
@ -13,106 +12,132 @@ cd "${0%/*}" || exit # Run from this directory
kEpsilonPhitF
"
# flag to enable computations
run=true
# flag to enable computations in parallel mode
parallel=true
# flag to enable to use a common mesh
common_mesh=true
# flag to enable to use a common dynamic code
common_dynamic_code=true
#------------------------------------------------------------------------------
#######################################
# Extract a value (Eg, from boundaryField/bump/value)
# Create the given setup
# Arguments:
# $1 = dictEntry
# $2 = inputFile
# $3 = outputFile
# $1 = Path to create the setup
# Outputs:
# Writes to 'outputFile'
# Notes:
# Only retains values between, but not including the ( ) delimiters.
# For example,
#----
# value nonuniform List<scalar>
# 110
# (
# 0.0041520092
# 0.012577691
# 0.021250264
# 0.030176962
# )
# ;
# Writes info to stdout
#######################################
extractVal()
{
if [ -f "$2" ]
dry_run_setup() {
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
setup="$1"
dirSetup="setups/$setup"
dirSetupOrig="setups.orig/$setup"
dirOrig="$dirSetupOrig/0.orig"
dirConstant="$dirSetupOrig/constant"
dirSystem="$dirSetupOrig/system"
printf "\n# Create the setup: %s\n" "$setup"
if [ ! -d "$dirSetup" ]
then
foamDictionary -entry "$1" -value "$2" | \
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
> "$3"
mkdir -p "$dirSetup"
cp -aRfL "setups.orig/common/." "$dirSetup"
cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || :
[ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig"
[ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant"
[ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system"
else
# Or some other tag?
echo "Not such file: $2" 1>&2
echo "0" > "$3"
printf "\n # Directory %s already exists\n" "$dirSetup"
printf " # Skipping the creation of a new setup\n"
fi
}
#######################################
# Collect results into a given path
# and clean the case for the next run
# Run the given setup
# Arguments:
# $1 = Path to move results
# $1 = Path to the setup to run
# Outputs:
# Writes info to stdout
#######################################
collect() {
run_setup() {
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
collection="$1"
setup="$1"
dirSetup="setups/$setup"
dirResult="results/$setup"
dirResult=results/"$collection"
dirSettings="$dirResult"/settings
dry_run_setup "$setup"
[ -d results ] || mkdir -p results
printf "\n# Run the setup: %s\n\n" "$setup"
if [ ! -d "$dirResult" ]
then
cp -Rf "$dirSetup" "$dirResult"
echo " # Collecting results and settings into $dirResult"
if [ "$common_mesh" = true ]
then
if [ -d results/mesh ]
then
printf "## Copy the common mesh to the setup: %s\n\n" "$setup"
cp -Rf results/mesh/polyMesh "$dirResult"/constant/.
fi
fi
mkdir -p "$dirResult"
mkdir -p "$dirSettings"
if [ "$common_dynamic_code" = true ]
then
if [ -d results/dynamicCode ]
then
printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup"
cp -Rf results/dynamicCode "$dirResult"/.
fi
fi
endTime=$(foamListTimes -latestTime)
# Create datasets for benchmark comparisons
extractVal boundaryField.bump.value "$endTime/Cx" Cx.$$
extractVal boundaryField.bump.value "$endTime/wallShearStress" tau.$$
extractVal boundaryField.bump.value "$endTime/Cp" cp.$$
if [ "$parallel" = true ]
then
( cd "$dirResult" && ./Allrun-parallel )
else
( cd "$dirResult" && ./Allrun )
fi
echo "# ccx tau_xx tau_yy tau_zz cp" > profiles.dat
paste -d ' ' Cx.$$ tau.$$ cp.$$ >> profiles.dat
rm -f Cx.$$ tau.$$ cp.$$
mv -f $(foamListTimes) "$dirResult"
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
[ -d processor0 ] && mv -f processor* "$dirResult"
mv -f log.* "$dirResult"
mv -f profiles.dat "$dirResult"
cp -f system/{fv*,controlDict} constant/*Properties "$dirSettings"
mv -f 0/ "$dirSettings"
if [ "$common_mesh" = true ]
then
if [ ! -d results/mesh ]
then
printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup"
mkdir -p results/mesh
cp -Rf "$dirResult"/constant/polyMesh results/mesh/.
fi
fi
echo " # Cleaning up the case"
if [ "$common_dynamic_code" = true ]
then
if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ]
then
printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup"
cp -Rf "$dirResult"/dynamicCode results/.
fi
fi
cleanTimeDirectories
cleanAuxiliary
cleanPostProcessing
else
echo " # Directory $dirResult already exists"
echo " # Skipping the computation"
printf " # Directory %s already exists\n" "$dirResult"
printf " # Skipping the computation of the given setup\n"
fi
}
@ -120,58 +145,28 @@ collect() {
for setup in $setups
do
dirSetupOrig="setups.orig/$setup"
echo ""
echo "# Computations for the setup: $setup"
echo ""
dirSetup="setups.orig/$setup"
if [ ! -d "$dirSetup" ]
if [ ! -d "$dirSetupOrig" ]
then
echo "Setup directory: $dirSetup" \
echo "Setup directory: $dirSetupOrig" \
"could not be found - skipping execution" 1>&2
exit 1
continue
fi
cp -rfL "$dirSetup/0.orig" .
cp -rfL "$dirSetup/constant" .
cp -rfL "$dirSetup/system" .
cp -rf 0.orig/ 0/
canCompile || exit 0 # Dynamic code
if [ ! -d constant/polyMesh ]
if [ "$run" = true ]
then
runApplication blockMesh
runApplication renumberMesh -overwrite -constant
runApplication checkMesh -allTopology -allGeometry -constant
fi
if [ "$parallel" = true ]
then
runApplication decomposePar
runParallel -s parallel renumberMesh -overwrite
runParallel $(getApplication)
runApplication reconstructPar
run_setup "$setup"
else
runApplication $(getApplication)
dry_run_setup "$setup"
fi
collect "$setup"
done
if notTest "$@" && [ "$run" = true ]
then
./plot
fi
#------------------------------------------------------------------------------

View File

@ -122,44 +122,39 @@ PLT_X_CP
# Requires gnuplot
command -v gnuplot >/dev/null || {
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
echo "gnuplot not found - skipping graph creation" 1>&2
exit 1
}
# Requires awk
command -v awk >/dev/null || {
echo "FOAM FATAL ERROR: awk not found - skipping graph creation" 1>&2
echo "awk not found - skipping graph creation" 1>&2
exit 1
}
# Check "results" directory
[ -d "results" ] || {
echo "FOAM FATAL ERROR: No results directory found - skipping graph creation" 1>&2
echo "No results directory found - skipping graph creation" 1>&2
exit 1
}
#------------------------------------------------------------------------------
if notTest "$@"
then
dirPlots="plots"
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
dirPlots="plots/$setup"
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
echo ""
echo "# Plots for the skin friction coefficient"
echo ""
echo ""
echo "# Plots for the skin friction coefficient"
echo ""
plot_x_vs_Cf "$Uref" $setups
plot_x_vs_Cf "$Uref" $setups
echo ""
echo "# Plots for the pressure coefficient"
echo ""
echo ""
echo "# Plots for the pressure coefficient"
echo ""
plot_x_vs_Cp "$Uref" $setups
fi
plot_x_vs_Cp "$Uref" $setups
# ------------------------------------------------------------------------------

View File

@ -1 +0,0 @@
../../common/constant/transportProperties

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,61 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
#######################################
# Extract a value (Eg, from boundaryField/bump/value)
# Arguments:
# $1 = dictEntry
# $2 = inputFile
# $3 = outputFile
# Outputs:
# Writes to 'outputFile'
# Notes:
# Only retains values between, but not including the ( ) delimiters.
# For example,
#----
# value nonuniform List<scalar>
# 110
# (
# 0.0041520092
# 0.012577691
# 0.021250264
# 0.030176962
# )
# ;
#######################################
extractVal()
{
if [ -f "$2" ]
then
foamDictionary -entry "$1" -value "$2" | \
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
> "$3"
else
# Or some other tag?
echo "Not such file: $2" 1>&2
echo "0" > "$3"
fi
}
#------------------------------------------------------------------------------
./Allrun.pre
runApplication $(getApplication)
endTime=$(foamListTimes -latestTime)
# Create datasets for benchmark comparisons
extractVal boundaryField.bump.value "$endTime/Cx" Cx.$$
extractVal boundaryField.bump.value "$endTime/wallShearStress" tau.$$
extractVal boundaryField.bump.value "$endTime/Cp" cp.$$
echo "# ccx tau_xx tau_yy tau_zz cp" > profiles.dat
paste -d ' ' Cx.$$ tau.$$ cp.$$ >> profiles.dat
rm -f Cx.$$ tau.$$ cp.$$
#------------------------------------------------------------------------------

View File

@ -0,0 +1,65 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
#######################################
# Extract a value (Eg, from boundaryField/bump/value)
# Arguments:
# $1 = dictEntry
# $2 = inputFile
# $3 = outputFile
# Outputs:
# Writes to 'outputFile'
# Notes:
# Only retains values between, but not including the ( ) delimiters.
# For example,
#----
# value nonuniform List<scalar>
# 110
# (
# 0.0041520092
# 0.012577691
# 0.021250264
# 0.030176962
# )
# ;
#######################################
extractVal()
{
if [ -f "$2" ]
then
foamDictionary -entry "$1" -value "$2" | \
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
> "$3"
else
# Or some other tag?
echo "Not such file: $2" 1>&2
echo "0" > "$3"
fi
}
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
runApplication reconstructPar
endTime=$(foamListTimes -latestTime)
# Create datasets for benchmark comparisons
extractVal boundaryField.bump.value "$endTime/Cx" Cx.$$
extractVal boundaryField.bump.value "$endTime/wallShearStress" tau.$$
extractVal boundaryField.bump.value "$endTime/Cp" cp.$$
echo "# ccx tau_xx tau_yy tau_zz cp" > profiles.dat
paste -d ' ' Cx.$$ tau.$$ cp.$$ >> profiles.dat
rm -f Cx.$$ tau.$$ cp.$$
#------------------------------------------------------------------------------

View File

@ -0,0 +1,19 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
canCompile || exit 0 # Dynamic code
restore0Dir
if [ ! -d constant/polyMesh ]
then
runApplication blockMesh
runApplication renumberMesh -overwrite -constant
runApplication checkMesh -allTopology -allGeometry -constant
fi
#------------------------------------------------------------------------------

View File

@ -1 +0,0 @@
../../common/constant/transportProperties

View File

@ -1 +0,0 @@
../../common/0.orig/U

View File

@ -1 +0,0 @@
../../common/0.orig/nut

View File

@ -1 +0,0 @@
../../common/0.orig/p

View File

@ -1 +0,0 @@
../../common/constant/transportProperties

View File

@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
rm -rf 0.orig
rm -rf system
rm -rf constant
rm -rf setups
rm -rf results
rm -rf plots
rm -f setups.orig/common/system/blockMeshDict

View File

@ -1,7 +1,6 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
# settings
@ -12,9 +11,18 @@ cd "${0%/*}" || exit # Run from this directory
kEpsilon
"
# flag to enable computations
run=true
# flag to enable computations in parallel mode
parallel=true
# flag to enable to use a common mesh
common_mesh=true
# flag to enable to use a common dynamic code
common_dynamic_code=true
# operand setups for the wall-normal height of the first-cell centre
declare -A grading_vs_yp
#level 5 gradings
@ -40,99 +48,119 @@ cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
#######################################
# Extract a value (Eg, from boundaryField/bump/value)
# Create the given setup
# Arguments:
# $1 = dictEntry
# $2 = inputFile
# $3 = outputFile
# $1 = Path to create the setup
# Outputs:
# Writes to 'outputFile'
# Notes:
# Only retains values between, but not including the ( ) delimiters.
# For example,
#----
# value nonuniform List<scalar>
# 110
# (
# 0.0041520092
# 0.012577691
# 0.021250264
# 0.030176962
# )
# ;
# Writes info to stdout
#######################################
extractVal()
{
if [ -f "$2" ]
dry_run_setup() {
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
setup="$1"
yp="$2"
dirSetup="setups/$setup/$yp"
dirSetupOrig="setups.orig/$setup"
dirOrig="$dirSetupOrig/0.orig"
dirConstant="$dirSetupOrig/constant"
dirSystem="$dirSetupOrig/system"
printf "\n# Create the setup: %s %s\n" "$setup" yPlus-"$yp"
if [ ! -d "$dirSetup" ]
then
foamDictionary -entry "$1" -value "$2" | \
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
> "$3"
mkdir -p "$dirSetup"
cp -aRfL "setups.orig/common/." "$dirSetup"
cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || :
[ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig"
[ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant"
[ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system"
else
# Or some other tag?
echo "Not such file: $2" 1>&2
echo "0" > "$3"
printf "\n # Directory %s already exists\n" "$dirSetup"
printf " # Skipping the creation of a new setup\n"
fi
}
#######################################
# Collect results into a given path
# and clean the case for the next run
# Run the given setup
# Arguments:
# $1 = Path to move results
# $1 = Path to the setup to run
# Outputs:
# Writes info to stdout
#######################################
collect() {
run_setup() {
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
collection="$1"
setup="$1"
yp="$2"
dirSetup="setups/$setup/$yp"
dirResult="results/$setup/$yp"
dirResult=results/"$collection"
dirSettings="$dirResult"/settings
dry_run_setup "$setup" "$yp"
[ -d results ] || mkdir -p results
[ -d results/"$setup" ] || mkdir -p results/"$setup"
printf "\n# Run the setup: %s %s\n\n" "$setup" yPlus-"$yp"
if [ ! -d "$dirResult" ]
then
cp -Rf "$dirSetup" "$dirResult"
echo " # Collecting results and settings into $dirResult"
if [ "$common_mesh" = true ]
then
if [ -d results/mesh ]
then
printf "## Copy the common mesh to the setup: %s\n\n" "$setup"
cp -Rf results/mesh/polyMesh "$dirResult"/constant/.
fi
fi
mkdir -p "$dirResult"
mkdir -p "$dirSettings"
if [ "$common_dynamic_code" = true ]
then
if [ -d results/dynamicCode ]
then
printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup"
cp -Rf results/dynamicCode "$dirResult"/.
fi
fi
endTime=$(foamListTimes -latestTime)
# Create datasets for benchmark comparisons
extractVal boundaryField.bottomWall.value "$endTime/Cx" Cx.$$
extractVal boundaryField.bottomWall.value "$endTime/wallShearStress" tau.$$
extractVal boundaryField.bottomWall.value "$endTime/yPlus" yPlus.$$
if [ "$parallel" = true ]
then
( cd "$dirResult" && ./Allrun-parallel )
else
( cd "$dirResult" && ./Allrun )
fi
echo "# ccx tau_xx tau_yy tau_zz y+" > profiles.dat
paste -d ' ' Cx.$$ tau.$$ yPlus.$$ >> profiles.dat
rm -f Cx.$$ tau.$$ yPlus.$$
mv -f $(foamListTimes) "$dirResult"
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
[ -d processor0 ] && mv -f processor* "$dirResult"
mv -f log.* "$dirResult"
mv -f profiles.dat "$dirResult"
cp -f system/{fv*,controlDict} constant/*Properties "$dirSettings"
mv -f 0/ "$dirSettings"
if [ "$common_mesh" = true ]
then
if [ ! -d results/mesh ]
then
printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup"
mkdir -p results/mesh
cp -Rf "$dirResult"/constant/polyMesh results/mesh/.
fi
fi
echo " # Cleaning up the case"
if [ "$common_dynamic_code" = true ]
then
if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ]
then
printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup"
cp -Rf "$dirResult"/dynamicCode results/.
fi
fi
cleanTimeDirectories
cleanAuxiliary
cleanPostProcessing
else
echo " # Directory $dirResult already exists"
echo " # Skipping the computation"
printf " # Directory %s already exists\n" "$dirResult"
printf " # Skipping the computation of the given setup\n"
fi
}
@ -140,7 +168,6 @@ collect() {
for i in "${!grading_vs_yp[@]}"
do
yp=$i
grading=${grading_vs_yp[$yp]}
@ -150,60 +177,31 @@ do
for setup in $setups
do
dirSetupOrig="setups.orig/$setup"
echo ""
echo "# Computations for the setup and y+: $setup - $yp"
echo ""
dirSetup="setups.orig/$setup"
if [ ! -d "$dirSetup" ]
if [ ! -d "$dirSetupOrig" ]
then
echo "Setup directory: $dirSetup" \
echo "Setup directory: $dirSetupOrig" \
"could not be found - skipping execution" 1>&2
exit 1
continue
fi
cp -rfL "$dirSetup/0.orig" .
cp -rfL "$dirSetup/constant" .
cp -rfL "$dirSetup/system" .
cp -rf 0.orig/ 0/
if [ ! -d constant/polyMesh ]
if [ "$run" = true ]
then
runApplication blockMesh
runApplication renumberMesh -overwrite -constant
runApplication checkMesh -allTopology -allGeometry -constant
fi
if [ "$parallel" = true ]
then
runApplication decomposePar
runParallel $(getApplication)
runApplication reconstructPar
run_setup "$setup" "$yp"
else
runApplication $(getApplication)
dry_run_setup "$setup" "$yp"
fi
collect "$setup/$yp"
done
rm -rf 0.orig
rm -rf constant
rm -rf system
rm -Rf results/mesh
done
#-----------------------------------------------------------------------------
if notTest "$@" && [ "$run" = true ]
then
./plot
fi
#------------------------------------------------------------------------------

View File

@ -63,7 +63,7 @@ plot_Rex_vs_Cf() {
plot \
weighardt(x) t "Weighardt" w lines lc "red" lw 2, \
samples u (\$1 - X0)*Uref/nu:(sqrt(\$2*\$2 + \$3*\$3 + \$4*\$4)/(0.5*Uref*Uref)) \
samples u (\$1 - x0)*Uref/nu:(sqrt(\$2*\$2 + \$3*\$3 + \$4*\$4)/(0.5*Uref*Uref)) \
t "$setup y^+ ${yp}" w l lc "black" lw 2
PLT_REX_VS_CF
}
@ -73,19 +73,19 @@ PLT_REX_VS_CF
# Requires gnuplot
command -v gnuplot >/dev/null || {
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
echo "gnuplot not found - skipping graph creation" 1>&2
exit 1
}
# Requires awk
command -v awk >/dev/null || {
echo "FOAM FATAL ERROR: awk not found - skipping graph creation" 1>&2
echo "awk not found - skipping graph creation" 1>&2
exit 1
}
# Check "results" directory
[ -d "results" ] || {
echo "FOAM FATAL ERROR: No results directory found - skipping graph creation" 1>&2
echo "No results directory found - skipping graph creation" 1>&2
exit 1
}
@ -94,26 +94,26 @@ command -v awk >/dev/null || {
for setup in $setups
do
for yp in $yps
do
echo ""
echo "# Plots for the setup and y+: $setup - $yp"
echo ""
dirPlots="plots/$setup/$yp"
resultsDir="results/$setup/$yp"
[ -d "$resultsDir" ] || {
echo "No $resultsDir directory found - skipping graph creation" 1>&2
continue
}
dirPlots="plots/$setup"
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
# few manipulations
resultsDir="results/$setup/$yp"
Uref=$(foamDictionary $resultsDir/0/U -entry internalField | sed 's/^.*(\s*\([^ ]*\).*/\1/g')
nu=$(foamDictionary $resultsDir/settings/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g')
nu=$(foamDictionary $resultsDir/constant/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g')
plot_Rex_vs_Cf "$setup" "$yp" "$Uref" "$nu"
done
done

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,61 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
#######################################
# Extract a value (Eg, from boundaryField/bump/value)
# Arguments:
# $1 = dictEntry
# $2 = inputFile
# $3 = outputFile
# Outputs:
# Writes to 'outputFile'
# Notes:
# Only retains values between, but not including the ( ) delimiters.
# For example,
#----
# value nonuniform List<scalar>
# 110
# (
# 0.0041520092
# 0.012577691
# 0.021250264
# 0.030176962
# )
# ;
#######################################
extractVal()
{
if [ -f "$2" ]
then
foamDictionary -entry "$1" -value "$2" | \
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
> "$3"
else
# Or some other tag?
echo "Not such file: $2" 1>&2
echo "0" > "$3"
fi
}
#------------------------------------------------------------------------------
./Allrun.pre
runApplication $(getApplication)
endTime=$(foamListTimes -latestTime)
# Create datasets for benchmark comparisons
extractVal boundaryField.bottomWall.value "$endTime/Cx" Cx.$$
extractVal boundaryField.bottomWall.value "$endTime/wallShearStress" tau.$$
extractVal boundaryField.bottomWall.value "$endTime/yPlus" yPlus.$$
echo "# ccx tau_xx tau_yy tau_zz y+" > profiles.dat
paste -d ' ' Cx.$$ tau.$$ yPlus.$$ >> profiles.dat
rm -f Cx.$$ tau.$$ yPlus.$$
#------------------------------------------------------------------------------

View File

@ -0,0 +1,65 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
#######################################
# Extract a value (Eg, from boundaryField/bump/value)
# Arguments:
# $1 = dictEntry
# $2 = inputFile
# $3 = outputFile
# Outputs:
# Writes to 'outputFile'
# Notes:
# Only retains values between, but not including the ( ) delimiters.
# For example,
#----
# value nonuniform List<scalar>
# 110
# (
# 0.0041520092
# 0.012577691
# 0.021250264
# 0.030176962
# )
# ;
#######################################
extractVal()
{
if [ -f "$2" ]
then
foamDictionary -entry "$1" -value "$2" | \
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
> "$3"
else
# Or some other tag?
echo "Not such file: $2" 1>&2
echo "0" > "$3"
fi
}
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
runApplication reconstructPar
endTime=$(foamListTimes -latestTime)
# Create datasets for benchmark comparisons
extractVal boundaryField.bottomWall.value "$endTime/Cx" Cx.$$
extractVal boundaryField.bottomWall.value "$endTime/wallShearStress" tau.$$
extractVal boundaryField.bottomWall.value "$endTime/yPlus" yPlus.$$
echo "# ccx tau_xx tau_yy tau_zz y+" > profiles.dat
paste -d ' ' Cx.$$ tau.$$ yPlus.$$ >> profiles.dat
rm -f Cx.$$ tau.$$ yPlus.$$
#------------------------------------------------------------------------------

View File

@ -0,0 +1,19 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
canCompile || exit 0 # Dynamic code
restore0Dir
if [ ! -d constant/polyMesh ]
then
runApplication blockMesh
runApplication renumberMesh -overwrite -constant
runApplication checkMesh -allTopology -allGeometry -constant
fi
#------------------------------------------------------------------------------

View File

@ -1 +0,0 @@
../../common/constant/transportProperties

View File

@ -1 +0,0 @@
../../common/constant/transportProperties

View File

@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
rm -rf 0.orig
rm -rf system
rm -rf constant
rm -rf setups
rm -rf results
rm -rf plots

View File

@ -1,7 +1,6 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
# settings
@ -12,54 +11,131 @@ cd "${0%/*}" || exit # Run from this directory
kOmegaSST
"
# flag to enable computations
run=true
# flag to enable computations in parallel mode
parallel=true
# flag to enable to use a common mesh
common_mesh=true
# flag to enable to use a common dynamic code
common_dynamic_code=false
#------------------------------------------------------------------------------
#######################################
# Collect results into a given path
# and clean the case for the next run
# Create the given setup
# Arguments:
# $1 = Path to move results
# $1 = Path to create the setup
# Outputs:
# Writes info to stdout
#######################################
collect() {
dry_run_setup() {
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
collection="$1"
setup="$1"
dirSetup="setups/$setup"
dirSetupOrig="setups.orig/$setup"
dirOrig="$dirSetupOrig/0.orig"
dirConstant="$dirSetupOrig/constant"
dirSystem="$dirSetupOrig/system"
dirResult=results/"$collection"
dirSettings="$dirResult"/settings
printf "\n# Create the setup: %s\n" "$setup"
if [ ! -d "$dirSetup" ]
then
mkdir -p "$dirSetup"
cp -aRfL "setups.orig/common/." "$dirSetup"
cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || :
[ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig"
[ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant"
[ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system"
else
printf "\n # Directory %s already exists\n" "$dirSetup"
printf " # Skipping the creation of a new setup\n"
fi
}
#######################################
# Run the given setup
# Arguments:
# $1 = Path to the setup to run
# Outputs:
# Writes info to stdout
#######################################
run_setup() {
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
setup="$1"
dirSetup="setups/$setup"
dirResult="results/$setup"
dry_run_setup "$setup"
[ -d results ] || mkdir -p results
printf "\n# Run the setup: %s\n\n" "$setup"
if [ ! -d "$dirResult" ]
then
cp -Rf "$dirSetup" "$dirResult"
echo " # Collecting results and settings into $dirResult"
if [ "$common_mesh" = true ]
then
if [ -d results/mesh ]
then
printf "## Copy the common mesh to the setup: %s\n\n" "$setup"
cp -Rf results/mesh/polyMesh "$dirResult"/constant/.
fi
fi
mkdir -p "$dirResult"
mkdir -p "$dirSettings"
if [ "$common_dynamic_code" = true ]
then
if [ -d results/dynamicCode ]
then
printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup"
cp -Rf results/dynamicCode "$dirResult"/.
fi
fi
mv -f $(foamListTimes) "$dirResult"
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
[ -d processor0 ] && mv -f processor* "$dirResult"
mv -f log.* "$dirResult"
cp -f system/{fv*,controlDict} constant/*Properties "$dirSettings"
mv -f 0/ "$dirSettings"
echo " # Cleaning up the case"
if [ "$parallel" = true ]
then
( cd "$dirResult" && ./Allrun-parallel )
else
( cd "$dirResult" && ./Allrun )
fi
if [ "$common_mesh" = true ]
then
if [ ! -d results/mesh ]
then
printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup"
mkdir -p results/mesh
cp -Rf "$dirResult"/constant/polyMesh results/mesh/.
fi
fi
if [ "$common_dynamic_code" = true ]
then
if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ]
then
printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup"
cp -Rf "$dirResult"/dynamicCode results/.
fi
fi
cleanTimeDirectories
cleanAuxiliary
cleanPostProcessing
else
echo " # Directory $dirResult already exists"
echo " # Skipping the computation"
printf " # Directory %s already exists\n" "$dirResult"
printf " # Skipping the computation of the given setup\n"
fi
}
@ -68,54 +144,28 @@ collect() {
for setup in $setups
do
dirSetupOrig="setups.orig/$setup"
echo ""
echo "# Computations for the setup: $setup"
echo ""
dirSetup="setups.orig/$setup"
if [ ! -d "$dirSetup" ]
if [ ! -d "$dirSetupOrig" ]
then
echo "Setup directory: $dirSetup" \
echo "Setup directory: $dirSetupOrig" \
"could not be found - skipping execution" 1>&2
exit 1
continue
fi
cp -rfL "$dirSetup/0.orig" .
cp -rfL "$dirSetup/constant" .
cp -rfL "$dirSetup/system" .
cp -rf 0.orig/ 0/
if [ ! -d constant/polyMesh ]
if [ "$run" = true ]
then
runApplication blockMesh
runApplication renumberMesh -overwrite -constant
runApplication checkMesh -allTopology -allGeometry -constant
fi
if [ "$parallel" = true ]
then
runApplication decomposePar
runParallel $(getApplication)
runApplication reconstructPar
run_setup "$setup"
else
runApplication $(getApplication)
dry_run_setup "$setup"
fi
collect "$setup"
done
if notTest "$@" && [ "$run" = true ]
then
./plot
fi
#------------------------------------------------------------------------------

View File

@ -31,7 +31,7 @@ plot_ux_vs_znorm_upstream() {
endTime="$1"
zMin="$2"
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/Ux-HW-RH-Fig6a"
benchmarkFile="resources/dataset/Ux-HW-RH-Fig6a"
sampleFile="results/$setup/postProcessing/samples_u/$endTime"
image="plots/$setup/ux_vs_znorm_upstream.png"
@ -72,7 +72,7 @@ plot_ux_vs_znorm_middle() {
endTime="$1"
zMin="$2"
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/Ux-HW-RH-Fig6a"
benchmarkFile="resources/dataset/Ux-HW-RH-Fig6a"
sampleFile="results/$setup/postProcessing/samples_u/$endTime"
image="plots/$setup/ux_vs_znorm_middle.png"
@ -113,7 +113,7 @@ plot_ux_vs_znorm_downstream() {
endTime="$1"
zMin="$2"
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/Ux-HW-RH-Fig6a"
benchmarkFile="resources/dataset/Ux-HW-RH-Fig6a"
sampleFile="results/$setup/postProcessing/samples_u/$endTime"
image="plots/$setup/ux_vs_znorm_downstream.png"
@ -154,7 +154,7 @@ plot_k_vs_znorm() {
endTime="$1"
zMin="$2"
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007"
benchmarkFile="resources/dataset"
sampleFile="results/$setup/postProcessing/samples_k/$endTime"
image="plots/$setup/k_vs_znorm.png"
@ -205,7 +205,7 @@ plot_epsilon_vs_znorm() {
endTime="$1"
zMin="$2"
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/epsilon-HW-RH-Fig6c"
benchmarkFile="resources/dataset/epsilon-HW-RH-Fig6c"
sampleFile="results/$setup/postProcessing/samples_epsilon/$endTime"
image="plots/$setup/epsilon_vs_znorm.png"
@ -299,7 +299,7 @@ plot_nut_vs_znorm() {
endTime="$1"
zMin="$2"
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/"
benchmarkFile="resources/dataset"
sampleFile="results/$setup/postProcessing/samples_nut/$endTime"
image="plots/$setup/nut_vs_znorm.png"
@ -361,16 +361,20 @@ command -v gnuplot >/dev/null || {
for setup in $setups
do
echo ""
echo "# Plots for the setup: $setup"
echo ""
[ -d "results/$setup" ] || {
echo "No results/$setup directory found - skipping graph creation" 1>&2
continue
}
dirPlots="plots/$setup"
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
endTime=$( \
foamDictionary results/$setup/settings/controlDict \
foamDictionary results/$setup/system/controlDict \
-disableFunctionEntries -entry endTime -value \
)
@ -383,32 +387,23 @@ do
if [ -d "results/$setup/postProcessing/samples_k" ]
then
plot_k_vs_znorm "$endTime" "$zMin"
fi
if [ -d "results/$setup/postProcessing/samples_epsilon" ]
then
plot_epsilon_vs_znorm "$endTime" "$zMin"
fi
if [ -d "results/$setup/postProcessing/samples_omega" ]
then
plot_omega_vs_znorm "$endTime" "$zMin"
fi
if [ -d "results/$setup/postProcessing/samples_nut" ]
then
plot_nut_vs_znorm "$endTime" "$zMin"
fi
done

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,10 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,14 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
./Allrun.pre
runApplication decomposePar
runParallel $(getApplication)
runApplication reconstructPar
#------------------------------------------------------------------------------

View File

@ -0,0 +1,17 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
if [ ! -d constant/polyMesh ]
then
runApplication blockMesh
runApplication renumberMesh -overwrite -constant
runApplication checkMesh -allTopology -allGeometry -constant
fi
#------------------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More