TUT: heatTransfer: clean up tutorials

This commit is contained in:
Kutalmis Bercin
2021-05-25 12:53:27 +01:00
committed by Andrew Heather
parent ad75af0e50
commit f62a599eef
720 changed files with 1843 additions and 56321 deletions

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -4,6 +4,7 @@ cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
runApplication blockMesh
runApplication topoSet
# Restore initial fields
@ -14,13 +15,13 @@ runApplication splitMeshRegions -cellZones -overwrite
# Remove fluid fields from solid regions (important for post-processing)
for region in $(foamListRegions solid)
do
rm -f 0/$region/{nut,alphat,epsilon,k,U,p_rgh}
rm -f processor*/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
for region in $(foamListRegions)
do
runApplication -s $region changeDictionary -region $region
runApplication -s "$region" changeDictionary -region "$region"
done
# Create coupling geometry

View File

@ -47,4 +47,5 @@ mixture
}
}
// ************************************************************************* //

View File

@ -16,4 +16,5 @@ FoamFile
simulationType laminar;
// ************************************************************************* //

View File

@ -17,4 +17,5 @@ FoamFile
dimensions [0 1 -2 0 0 0 0];
value (0 -9.81 0);
// ************************************************************************* //

View File

@ -5,13 +5,11 @@
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -20,4 +18,5 @@ radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -31,22 +31,20 @@ mixture
{
molWeight 50;
}
transport
{
kappa 80;
}
thermodynamics
{
Hf 0;
Cp 450;
}
equationOfState
{
rho 8000;
}
}
// ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object regionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,4 +20,5 @@ regions
solid (heater leftSolid rightSolid)
);
// ************************************************************************* //

View File

@ -93,4 +93,5 @@ mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -16,7 +16,7 @@ FoamFile
ddtSchemes
{
default steadyState;
default steadyState;
}
gradSchemes
@ -29,13 +29,17 @@ divSchemes
default none;
div(phi,U) bounded Gauss upwind;
div(phi,K) bounded Gauss upwind;
div(phi,h) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,K) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,R) bounded Gauss upwind;
energy bounded Gauss upwind;
div(phi,K) $energy;
div(phi,h) $energy;
turbulence bounded Gauss upwind;
div(phi,k) $turbulence;
div(phi,epsilon) $turbulence;
div(phi,R) $turbulence;
div(R) Gauss linear;
div(Ji,Ii_h) Gauss linearUpwind grad(U);
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
@ -55,4 +59,5 @@ snGradSchemes
default uncorrected;
}
// ************************************************************************* //

View File

@ -29,9 +29,7 @@ solvers
solver GAMG;
tolerance 1e-7;
relTol 0.01;
smoother GaussSeidel;
}
"(U|h|k|epsilon|G|Ii)"
@ -78,4 +76,5 @@ relaxationFactors
}
}
// ************************************************************************* //

View File

@ -166,4 +166,5 @@ p
}
}
// ************************************************************************* //

View File

@ -16,7 +16,7 @@ FoamFile
ddtSchemes
{
default Euler;
default Euler;
}
gradSchemes
@ -29,12 +29,16 @@ divSchemes
default none;
div(phi,U) Gauss upwind;
div(phi,K) Gauss linear;
div(phi,h) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind;
turbulence Gauss upwind;
div(phi,k) $turbulence;
div(phi,epsilon) $turbulence;
div(phi,R) $turbulence;
div(R) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -36,7 +36,6 @@ solvers
solver GAMG;
tolerance 1e-7;
relTol 0.01;
smoother GaussSeidel;
}
@ -84,4 +83,5 @@ relaxationFactors
}
}
// ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -30,4 +30,5 @@ constraints
}
*/
// ************************************************************************* //

View File

@ -14,7 +14,6 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
SIMPLE
{
energyCoupling

View File

@ -68,4 +68,5 @@ T
}
}
// ************************************************************************* //

View File

@ -16,7 +16,7 @@ FoamFile
ddtSchemes
{
default steadyState;
default steadyState;
}
gradSchemes

View File

@ -38,4 +38,5 @@ relaxationFactors
}
}
// ************************************************************************* //

View File

@ -57,4 +57,5 @@ T
}
}
// ************************************************************************* //

View File

@ -38,4 +38,5 @@ relaxationFactors
}
}
// ************************************************************************* //

View File

@ -47,4 +47,5 @@ T
}
}
// ************************************************************************* //

View File

@ -38,4 +38,5 @@ relaxationFactors
}
}
// ************************************************************************* //

View File

@ -172,4 +172,5 @@ p
}
}
// ************************************************************************* //

View File

@ -29,9 +29,7 @@ solvers
solver GAMG;
tolerance 1e-7;
relTol 0.01;
smoother GaussSeidel;
}
"(U|h|k|epsilon|G|Ii)"
@ -78,4 +76,5 @@ relaxationFactors
}
}
// ************************************************************************* //

View File

@ -12,7 +12,6 @@ FoamFile
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -25,17 +24,20 @@ boundaryField
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform 300;
}
outlet
{
type inletOutlet;
inletValue uniform 300;
value uniform 300;
}
blades
{
type zeroGradient;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -25,17 +24,20 @@ boundaryField
{
type noSlip;
}
inlet
{
type fixedValue;
value uniform (0 0 5);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
blades
{
type noSlip;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0/air";
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,16 +25,19 @@ boundaryField
type compressible::alphatWallFunction;
value uniform 0;
}
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
blades
{
type compressible::alphatWallFunction;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,15 +25,18 @@ boundaryField
type epsilonWallFunction;
value $internalField;
}
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type zeroGradient;
}
blades
{
type epsilonWallFunction;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,15 +25,18 @@ boundaryField
type kqRWallFunction;
value $internalField;
}
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type zeroGradient;
}
blades
{
type kqRWallFunction;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0/air";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,16 +25,19 @@ boundaryField
type nutkWallFunction;
value uniform 0;
}
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
blades
{
type nutkWallFunction;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,16 +25,19 @@ boundaryField
type calculated;
value uniform 100000;
}
inlet
{
type calculated;
value uniform 100000;
}
outlet
{
type calculated;
value uniform 100000;
}
blades
{
type calculated;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -25,15 +24,18 @@ boundaryField
{
type fixedFluxPressure;
}
inlet
{
type fixedFluxPressure;
}
outlet
{
type fixedValue;
value $internalField;
}
blades
{
type fixedFluxPressure;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object AoV;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,12 +25,14 @@ boundaryField
type fixedValue;
value uniform 400;
}
outlet
{
type inletOutlet;
inletValue uniform 350;
value uniform 350;
}
fixedWalls
{
type zeroGradient;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,12 +25,14 @@ boundaryField
type fixedValue;
value uniform (0.01 0 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
fixedWalls
{
type noSlip;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object htcConst;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,11 +25,13 @@ boundaryField
type calculated;
value uniform 100000;
}
outlet
{
type calculated;
value uniform 100000;
}
fixedWalls
{
type calculated;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -25,11 +24,13 @@ boundaryField
{
type fixedFluxPressure;
}
outlet
{
type fixedValue;
value uniform 100000;
}
fixedWalls
{
type fixedFluxPressure;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object MRFProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -5,13 +5,11 @@
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,5 +19,4 @@ radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,4 +50,5 @@ mixture
}
}
// ************************************************************************* //

View File

@ -10,12 +10,11 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
simulationType RAS;
RAS
{

View File

@ -10,13 +10,11 @@ FoamFile
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
//value ( 0 0 9.81);
value ( 0 0 0);

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -51,4 +51,5 @@ mixture
}
}
// ************************************************************************* //

View File

@ -16,4 +16,5 @@ FoamFile
simulationType laminar;
// ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object regionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,4 +20,5 @@ regions
solid ()
);
// ************************************************************************* //

View File

@ -146,4 +146,5 @@ mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -16,11 +16,7 @@ FoamFile
numberOfSubdomains 4;
method scotch;
method scotch;
coeffs
{
n (2 2 1);
}
// ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -29,12 +28,18 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div(phi,h) bounded Gauss upwind;
div(phi,e) bounded Gauss upwind;
div(phi,K) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
energy bounded Gauss upwind;
div(phi,h) $energy;
div(phi,e) $energy;
div(phi,K) $energy;
turbulence bounded Gauss upwind;
div(phi,k) $turbulence;
div(phi,epsilon) $turbulence;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -22,10 +21,7 @@ solvers
solver GAMG;
tolerance 1e-7;
relTol 0.01;
smoother DIC;
maxIter 100;
}
@ -45,7 +41,6 @@ SIMPLE
rhoMin 1;
}
relaxationFactors
{
fields

View File

@ -12,7 +12,6 @@ FoamFile
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions

View File

@ -12,7 +12,6 @@ FoamFile
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -16,11 +16,7 @@ FoamFile
numberOfSubdomains 4;
method scotch;
method scotch;
coeffs
{
n (2 2 1);
}
// ************************************************************************* //

View File

@ -19,4 +19,5 @@ PIMPLE
nOuterCorrectors 1;
}
// ************************************************************************* //

View File

@ -73,4 +73,5 @@ mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -23,4 +23,5 @@ coeffs
n (2 2 1);
}
// ************************************************************************* //

View File

@ -27,13 +27,19 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div(phi,h) bounded Gauss upwind;
div(phi,e) bounded Gauss upwind;
div(phi,Ekp) bounded Gauss upwind;
div(phi,K) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
energy bounded Gauss upwind;
div(phi,h) $energy;
div(phi,e) $energy;
div(phi,Ekp) $energy;
div(phi,K) $energy;
turbulence bounded Gauss upwind;
div(phi,k) $turbulence;
div(phi,epsilon) $turbulence;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
@ -52,4 +58,5 @@ snGradSchemes
default uncorrected;
}
// ************************************************************************* //

View File

@ -21,10 +21,7 @@ solvers
solver GAMG;
tolerance 1e-7;
relTol 0.01;
smoother DIC;
maxIter 10;
}

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0/solid";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,19 +25,23 @@ boundaryField
type fixedValue;
value uniform 500;
}
right
{
type fixedValue;
value uniform 500;
}
top
{
type zeroGradient;
}
bottom
{
type zeroGradient;
}
frontAndBack
{
type empty;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0/heater";
object jouleHeatingSource:V;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,19 +25,23 @@ boundaryField
type fixedValue;
value uniform 1.5;
}
right
{
type fixedValue;
value uniform 0;
}
top
{
type zeroGradient;
}
bottom
{
type zeroGradient;
}
frontAndBack
{
type empty;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0/heater";
object jouleHeatingSource:sigma;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -25,18 +24,22 @@ boundaryField
{
type zeroGradient;
}
right
{
type zeroGradient;
}
top
{
type zeroGradient;
}
bottom
{
type zeroGradient;
}
frontAndBack
{
type empty;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0/solid";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,6 +25,7 @@ boundaryField
type calculated;
value uniform 100000;
}
frontAndBack
{
type empty;

View File

@ -7,6 +7,7 @@ cleanCase0
foamCleanPolyMesh -region solid
rm -f *.OpenFOAM OF_vs_ANALYTICAL.eps
rm -f *.OpenFOAM
rm -f x_vs_T.png
#------------------------------------------------------------------------------

View File

@ -9,7 +9,7 @@ runApplication $(getApplication)
if notTest "$@"
then
./createGraphs
./plot
fi
#------------------------------------------------------------------------------

View File

@ -11,6 +11,9 @@ runParallel $(getApplication)
runApplication -s solid reconstructPar -latestTime -region solid
./createGraphs
if notTest "$@"
then
./plot
fi
#------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
# Create meshe
# Create mesh
runApplication -s solid blockMesh -region solid
# create dummy files for post-processing

View File

@ -17,4 +17,5 @@ FoamFile
dimensions [0 1 -2 0 0 0 0];
value (0 -9.81 0);
// ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object regionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,4 +20,5 @@ regions
solid (solid)
);
// ************************************************************************* //

View File

@ -31,18 +31,15 @@ mixture
{
molWeight 12;
}
transport
{
kappa 200;
}
thermodynamics
{
Hf 0;
Cp 700;
}
equationOfState
{
rho 8000;

View File

@ -6,7 +6,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017 OpenCFD Ltd.
# Copyright (C) 2017-2021 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -25,26 +25,71 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# createGraphs
# plot
#
# Description
# Creates .eps graph of OpenFOAM results vs analytical solution for the
# Creates .png graph of OpenFOAM results vs analytical solution for the
# Joule heating case
#
#------------------------------------------------------------------------------
cd "${0%/*}" || exit # Run from this directory
cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
# Stop on first error
set -e
# settings
# Require gnuplot
# stop on first error
set -e
#------------------------------------------------------------------------------
plot_x_vs_T()
{
sampleFile="$1"
image="x_vs_T.png"
gnuplot<<EOF
set terminal pngcairo font "helvetica,20" size 1000, 1000
set grid
set key left top
set xlabel "Length, x / [m]"
set ylabel "Temperature / [K]"
set output "$image"
# Benchmark - Analytical
rho = 7.837e-6
sigma = 1/rho
kappa = 200
L = 2.5
D = 0.1
H = 0.1
vol = 2.0*L*D*H
V = 1.5
R = rho*2*L/(D*H)
I = V/R
P = I*V
Q = P/vol
Ts = 500
T(x) = Q*L*L/(2*kappa)*(1-(x/L)*(x/L)) + Ts
# OpenFOAM
samples="$sampleFile"
plot \
samples u 1:2 t "OpenFOAM" w l, \
T(x) t "Analytical" w linespoints lt 0 pt 6 pi 15
EOF
}
#------------------------------------------------------------------------------
# Requires "gnuplot"
command -v gnuplot >/dev/null || {
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
exit 1
}
echo "Creating graph"
OFDATA='postProcessing/sample1/solid/20000/centreLine_T_jouleHeatingSource:V_jouleHeatingSource:sigma.xy'
[ -f "$OFDATA" ] || {
@ -52,35 +97,16 @@ OFDATA='postProcessing/sample1/solid/20000/centreLine_T_jouleHeatingSource:V_jou
exit 1
}
gnuplot<<EOF
set terminal postscript eps color enhanced
set output "OF_vs_ANALYTICAL.eps"
set xlabel "Length, x / [m]"
set ylabel "Temperature / [K]"
set grid
set key left top
rho = 7.837e-6
sigma = 1/rho
kappa = 200
L = 2.5
D = 0.1
H = 0.1
vol = 2.0*L*D*H
V = 1.5
R = rho*2*L/(D*H)
I = V/R
P = I*V
Q = P/vol
Ts = 500
T(x) = Q*L*L/(2*kappa)*(1-(x/L)*(x/L)) + Ts
#------------------------------------------------------------------------------
plot \
"$OFDATA" u 1:2 w lines title "OpenFOAM", \
T(x) w linespoints lt 0 pt 6 pi 15 title "Analytical"
EOF
echo ""
echo "# Plot:"
echo ""
plot_x_vs_T "$OFDATA"
echo "End"
#------------------------------------------------------------------------------

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -18,4 +18,5 @@ numberOfSubdomains 4;
method scotch;
// ************************************************************************* //

View File

@ -86,4 +86,5 @@ mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -46,4 +46,5 @@ relaxationFactors
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -27,4 +27,5 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -11,15 +11,15 @@ cd "${0%/*}" || exit # Run from this directory
# Agglomerate patch faces
for region in bottomAir topAir
do
runApplication -s $region \
faceAgglomerate -region $region -dict constant/viewFactorsDict
runApplication -s "$region" \
faceAgglomerate -region "$region" -dict constant/viewFactorsDict
done
# Generate view factors
for region in bottomAir topAir
do
runApplication -s $region \
viewFactorsGen -region $region
runApplication -s "$region" \
viewFactorsGen -region "$region"
done
runApplication $(getApplication)

View File

@ -14,15 +14,15 @@ runApplication decomposePar -allRegions
# Agglomerate patch faces
for region in bottomAir topAir
do
runParallel -s $region \
faceAgglomerate -region $region -dict constant/viewFactorsDict
runParallel -s "$region" \
faceAgglomerate -region "$region" -dict constant/viewFactorsDict
done
# Generate view factors
for region in bottomAir topAir
do
runParallel -s $region \
viewFactorsGen -region $region
runParallel -s "$region" \
viewFactorsGen -region "$region"
done
# Run

View File

@ -4,6 +4,7 @@ cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
runApplication blockMesh
runApplication topoSet
# Restore initial fields
@ -14,13 +15,13 @@ runApplication splitMeshRegions -cellZones -overwrite
# Remove fluid fields from solid regions (important for post-processing)
for region in $(foamListRegions solid)
do
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}
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
for region in $(foamListRegions)
do
runApplication -s $region changeDictionary -region $region
runApplication -s "$region" changeDictionary -region "$region"
done
#------------------------------------------------------------------------------

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object boundaryRadiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -35,4 +34,5 @@ scatterModel none;
sootModel none;
// ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant/bottomAir";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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