TUT: added tutorial files (issue #671)

- also cleanup by using 0.orig/ directory.
- use foamListRegions to obtain region names
This commit is contained in:
Mark Olesen
2017-12-19 14:40:33 +01:00
parent 5713efede3
commit 8bf98e74da
46 changed files with 296 additions and 145 deletions

View File

@ -2,23 +2,11 @@
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase cleanCase0
rm -rf comms rm -rf comms
rm -rf VTK rm -rf VTK
rm -rf constant/cellToRegion rm -rf constant/cellToRegion
rm -rf constant/*/polyMesh # region meshes
rm -rf 0/bottomWater
rm -rf 0/topAir
rm -rf 0/heater
rm -rf 0/leftSolid
rm -rf 0/rightSolid
rm -f 0/cellToRegion
rm -rf constant/bottomWater/polyMesh
rm -rf constant/topAir/polyMesh
rm -rf constant/heater/polyMesh
rm -rf constant/leftSolid/polyMesh
rm -rf constant/rightSolid/polyMesh
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,18 +4,22 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication blockMesh runApplication blockMesh
runApplication topoSet runApplication topoSet
# Restore initial fields
restore0Dir
runApplication splitMeshRegions -cellZones -overwrite runApplication splitMeshRegions -cellZones -overwrite
# remove fluid fields from solid regions (important for post-processing) # Remove fluid fields from solid regions (important for post-processing)
for i in heater leftSolid rightSolid for region in $(foamListRegions solid)
do do
rm -f 0*/$i/{nut,alphat,epsilon,k,U,p_rgh} rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh}
rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh}
done done
for region in $(foamListRegions)
for i in bottomWater topAir heater leftSolid rightSolid
do do
changeDictionary -region $i > log.changeDictionary.$i 2>&1 runApplication -s $region changeDictionary -region $region
done done
# Create coupling geometry # Create coupling geometry
@ -23,8 +27,7 @@ runApplication createExternalCoupledPatchGeometry \
-regions '(topAir heater)' coupleGroup -regions '(topAir heater)' coupleGroup
echo echo
echo "creating files for paraview post-processing" echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo echo
paraFoam -touchAll 2>/dev/null
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -6,11 +6,7 @@ cleanCase0
rm -rf VTK rm -rf VTK
rm -rf constant/cellToRegion rm -rf constant/cellToRegion
rm -rf constant/*/polyMesh # region meshes
rm -rf constant/air/polyMesh
rm -rf constant/solid/polyMesh
rm -rf constant/floor/polyMesh
rm -rf constant/triSurface
rm -f constant/air/F rm -f constant/air/F
rm -f constant/air/constructMap* rm -f constant/air/constructMap*
@ -19,11 +15,4 @@ rm -f constant/air/globalFaceFaces
rm -f constant/air/mapDist rm -f constant/air/mapDist
rm -f constant/air/visibleFaceFaces rm -f constant/air/visibleFaceFaces
rm -f 0/air/facesAgglomeration
rm -f 0/air/viewFactorField
rm -f 0/air/cellToRegion
rm -f 0/floor/cellToRegion
rm -f 0/solid/cellToRegion
rm -f 0/cellToRegion
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -8,24 +8,23 @@ cd ${0%/*} || exit 1 # Run from this directory
#-- Run on single processor #-- Run on single processor
# Agglomerate patch faces # Agglomerate patch faces
for i in air for region in air
do do
runApplication -s $i \ runApplication -s $region \
faceAgglomerate -region $i -dict constant/viewFactorsDict faceAgglomerate -region $region -dict constant/viewFactorsDict
done done
# Generate view factors # Generate view factors
for i in air for region in air
do do
runApplication -s $i \ runApplication -s $region \
viewFactorsGen -region $i viewFactorsGen -region $region
done done
runApplication $(getApplication) runApplication $(getApplication)
echo echo
echo "Creating files for paraview post-processing" echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo echo
paraFoam -touchAll
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -11,17 +11,17 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication decomposePar -allRegions -constant runApplication decomposePar -allRegions -constant
# Agglomerate patch faces # Agglomerate patch faces
for i in air for region in air
do do
runParallel -s $i \ runParallel -s $region \
faceAgglomerate -region $i -dict constant/viewFactorsDict faceAgglomerate -region $region -dict constant/viewFactorsDict
done done
# Generate view factors # Generate view factors
for i in air for region in air
do do
runParallel -s $i \ runParallel -s $region \
viewFactorsGen -region $i viewFactorsGen -region $region
done done
# Set the initial fields # Set the initial fields
@ -33,8 +33,7 @@ runParallel $(getApplication)
runApplication reconstructPar -allRegions runApplication reconstructPar -allRegions
echo echo
echo "Creating files for paraview post-processing" echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo echo
paraFoam -touchAll
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -10,18 +10,19 @@ runApplication splitMeshRegions -cellZones -overwrite
rm -rf 0/domain3 constant/domain3 system/domain3 rm -rf 0/domain3 constant/domain3 system/domain3
# Remove fluid fields from solid regions (important for post-processing) # Remove fluid fields from solid regions (important for post-processing)
for i in solid floor for region in $(foamListRegions solid)
do do
rm -f 0*/$i/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault} rm -f 0/$region/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
rm -f processor*/0/$region/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
done done
# Set the initial fields # Set the initial fields
restore0Dir restore0Dir
for i in air solid floor for region in $(foamListRegions)
do do
runApplication -s $i changeDictionary \ runApplication -s $region changeDictionary \
-region $i -subDict dictionaryReplacement -region $region -subDict dictionaryReplacement
done done
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -6,11 +6,6 @@ cleanCase0
rm -rf VTK rm -rf VTK
rm -rf constant/cellToRegion rm -rf constant/cellToRegion
rm -rf constant/*/polyMesh # region meshes
rm -rf constant/bottomWater/polyMesh
rm -rf constant/topAir/polyMesh
rm -rf constant/heater/polyMesh
rm -rf constant/leftSolid/polyMesh
rm -rf constant/rightSolid/polyMesh
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -14,6 +14,7 @@ runApplication splitMeshRegions -cellZones -overwrite
for region in $(foamListRegions solid) for region in $(foamListRegions solid)
do do
rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh} rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh}
rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh}
done done
for region in $(foamListRegions) for region in $(foamListRegions)

View File

@ -9,11 +9,6 @@ rm -f constant/triSurface/*.eMesh > /dev/null 2>&1
rm -rf VTK rm -rf VTK
rm -rf constant/cellToRegion rm -rf constant/cellToRegion
rm -rf constant/*/polyMesh # region meshes
rm -rf constant/bottomAir/polyMesh
rm -rf constant/topAir/polyMesh
rm -rf constant/heater/polyMesh
rm -rf constant/leftSolid/polyMesh
rm -rf constant/rightSolid/polyMesh
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -18,6 +18,7 @@ runApplication splitMeshRegions -cellZones -overwrite
for region in $(foamListRegions solid) for region in $(foamListRegions solid)
do do
rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh} rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh}
rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh}
done done
for region in $(foamListRegions) for region in $(foamListRegions)

View File

@ -4,7 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase0 cleanCase0
rm -rf constant/windshield/polyMesh rm -rf constant/*/polyMesh # region meshes
rm -rf constant/cabin/polyMesh
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -30,8 +30,7 @@ runParallel $(getApplication)
runApplication reconstructPar -allRegions runApplication reconstructPar -allRegions
echo echo
echo "creating files for paraview post-processing" echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo echo
paraFoam -touchAll
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,8 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase0 cleanCase0
rm -rf constant/exterior/polyMesh rm -rf constant/*/polyMesh # region meshes
rm -rf constant/ice/polyMesh
rm -rf constant/cabin/polyMesh
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -16,5 +16,4 @@ runApplication -s cabin reconstructPar -region cabin
runApplication -s ice reconstructPar -region ice runApplication -s ice reconstructPar -region ice
runApplication -s exterior reconstructPar -region exterior runApplication -s exterior reconstructPar -region exterior
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -0,0 +1,30 @@
/*--------------------------------*- 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 volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0.01 0 0);
boundaryField
{
".*"
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- 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 volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 0.01;
boundaryField
{
".*"
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- 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 volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0.1;
boundaryField
{
".*"
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -2,19 +2,12 @@
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase cleanCase0
rm -rf comms rm -rf comms
rm -rf VTK rm -rf VTK
rm -rf constant/cellToRegion rm -rf constant/cellToRegion
rm -rf 0/bottomWater
rm -rf 0/topAir
rm -rf 0/heater
rm -rf 0/leftSolid
rm -rf 0/rightSolid
rm -f 0/cellToRegion
rm -rf constant/bottomWater/polyMesh rm -rf constant/bottomWater/polyMesh
rm -rf constant/topAir/polyMesh rm -rf constant/topAir/polyMesh
rm -rf constant/heater/polyMesh rm -rf constant/heater/polyMesh

View File

@ -4,27 +4,30 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication blockMesh runApplication blockMesh
runApplication topoSet runApplication topoSet
# Restore initial fields
restore0Dir
runApplication splitMeshRegions -cellZones -overwrite runApplication splitMeshRegions -cellZones -overwrite
# remove fluid fields from solid regions (important for post-processing) # Remove fluid fields from solid regions (important for post-processing)
for i in heater leftSolid rightSolid for region in $(foamListRegions solid)
do do
rm -f 0*/$i/{nut,alphat,epsilon,k,U,p_rgh} rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh}
rm -f processor*/0/$region/{nut,alphat,epsilon,k,U,p_rgh}
done done
for region in $(foamListRegions)
for i in bottomWater topAir heater leftSolid rightSolid
do do
changeDictionary -region $i > log.changeDictionary.$i 2>&1 runApplication -s $region changeDictionary -region $region
done done
# Create coupling geometry # Create coupling geometry
runApplication createExternalCoupledPatchGeometry \ runApplication createExternalCoupledPatchGeometry \
-regions '(topAir heater)' coupleGroup -regions '(topAir heater)' coupleGroup
# echo echo
# echo "creating files for paraview post-processing" echo "Use paraFoam -touch-all to create files for paraview post-processing"
# echo echo
# paraFoam -touchAll 2>/dev/null
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -20,16 +20,6 @@ numberOfSubdomains 4;
// preserveFaceZones (heater solid1 solid3); // preserveFaceZones (heater solid1 solid3);
method scotch; method scotch;
// method hierarchical;
// method simple;
// method manual;
coeffs
{
n (2 2 1);
//delta 0.001; // default=0.001
//order xyz; // default=xzy
dataFile "decompositionData";
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -13,6 +13,9 @@ externalCoupled
// Does external process start first // Does external process start first
initByExternal true; initByExternal true;
// Frequency of coupling
calcFrequency 4;
// Additional output // Additional output
log true; log true;

View File

@ -19,7 +19,11 @@ SIMPLE
{ {
energyCoupling energyCoupling
{ {
iterations 50; iterations 10;
timeStart 10;
timeEnd 100;
interval 0; interval 0;

View File

@ -2,26 +2,27 @@
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
#create meshes # Create meshes
runApplication -s air blockMesh -region air runApplication -s air blockMesh -region air
runApplication -s porous blockMesh -region porous runApplication -s porous blockMesh -region porous
# create rotor blades in air region # Create rotor blades in air region
runApplication -s air.1 \ runApplication -s air.1 \
topoSet -region air -dict system/topoSetDict.1 topoSet -region air -dict system/topoSetDict.1
runApplication createBaffles -region air -overwrite runApplication createBaffles -region air -overwrite
# create rotor zone in air region for MRF # Create rotor zone in air region for MRF
runApplication -s air.2 \ runApplication -s air.2 \
topoSet -region air -dict system/topoSetDict.2 topoSet -region air -dict system/topoSetDict.2
rm -rf constant/air/polyMesh/sets rm -rf constant/air/polyMesh/sets
# create dummy files for post-processing # Create dummy files for post-processing
paraFoam -touch -region porous paraFoam -touch -region porous
paraFoam -touch -region air paraFoam -touch -region air
# Set initial fields
restore0Dir restore0Dir
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -0,0 +1,22 @@
/*--------------------------------*- 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 fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
SIMPLE
{
}
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- 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 volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
".*"
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- 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 volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
".*"
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- 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 volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
".*"
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -2,22 +2,11 @@
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase cleanCase0
rm -rf VTK rm -rf VTK
rm -rf constant/cellToRegion rm -rf constant/cellToRegion
rm -rf 0/bottomAir rm -rf constant/*/polyMesh # region meshes
rm -rf 0/topAir
rm -rf 0/heater
rm -rf 0/leftSolid
rm -rf 0/rightSolid
rm -f 0/cellToRegion
rm -rf constant/bottomAir/polyMesh
rm -rf constant/topAir/polyMesh
rm -rf constant/heater/polyMesh
rm -rf constant/leftSolid/polyMesh
rm -rf constant/rightSolid/polyMesh
rm -f constant/bottomAir/F rm -f constant/bottomAir/F
rm -f constant/bottomAir/constructMap* rm -f constant/bottomAir/constructMap*

View File

@ -2,32 +2,29 @@
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
# Setup case # Setup case
./Allrun.pre ./Allrun.pre
#-- Run on single processor #-- Run on single processor
# Agglomerate patch faces # Agglomerate patch faces
for i in bottomAir topAir for region in bottomAir topAir
do do
runApplication -s $i \ runApplication -s $region \
faceAgglomerate -region $i -dict constant/viewFactorsDict faceAgglomerate -region $region -dict constant/viewFactorsDict
done done
# Generate view factors # Generate view factors
for i in bottomAir topAir for region in bottomAir topAir
do do
runApplication -s $i \ runApplication -s $region \
viewFactorsGen -region $i viewFactorsGen -region $region
done done
runApplication $(getApplication) runApplication $(getApplication)
echo echo
echo "creating files for paraview post-processing" echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo echo
paraFoam -touchAll
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -11,17 +11,17 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication decomposePar -allRegions runApplication decomposePar -allRegions
# Agglomerate patch faces # Agglomerate patch faces
for i in bottomAir topAir for region in bottomAir topAir
do do
runParallel -s $i \ runParallel -s $region \
faceAgglomerate -region $i -dict constant/viewFactorsDict faceAgglomerate -region $region -dict constant/viewFactorsDict
done done
# Generate view factors # Generate view factors
for i in bottomAir topAir for region in bottomAir topAir
do do
runParallel -s $i \ runParallel -s $region \
viewFactorsGen -region $i viewFactorsGen -region $region
done done
# Run # Run
@ -31,8 +31,7 @@ runParallel $(getApplication)
runApplication reconstructPar -allRegions runApplication reconstructPar -allRegions
echo echo
echo "Creating files for paraview post-processing" echo "Use paraFoam -touch-all to create files for paraview post-processing"
echo echo
paraFoam -touchAll
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,18 +4,22 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication blockMesh runApplication blockMesh
runApplication topoSet runApplication topoSet
# Restore initial fields
restore0Dir
runApplication splitMeshRegions -cellZones -overwrite runApplication splitMeshRegions -cellZones -overwrite
# remove fluid fields from solid regions (important for post-processing) # Remove fluid fields from solid regions (important for post-processing)
for i in heater leftSolid rightSolid for region in $(foamListRegions solid)
do do
rm -f 0*/$i/{rho,nut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault} rm -f 0/$region/{rho,nut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
rm -f processor*/0/$region/{rho,nut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
done done
for i in bottomAir topAir heater leftSolid rightSolid for region in $(foamListRegions)
do do
runApplication -s $i changeDictionary -region $i runApplication -s $region changeDictionary -region $region
done done
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------