From 3449f4a503d87439c2a5711ed3b5c2cf29b7cf75 Mon Sep 17 00:00:00 2001 From: Chris Greenshields Date: Tue, 11 Aug 2015 14:48:58 +0100 Subject: [PATCH 1/2] Template explicitPorositySource fvOption with a set of template coordinate systems for the porous media --- .../general/coordinateSystem/cartesianXY | 26 ++++++++ .../general/coordinateSystem/cartesianXZ | 26 ++++++++ .../general/coordinateSystem/cartesianYZ | 26 ++++++++ .../general/coordinateSystem/cylindrical | 24 ++++++++ .../general/fvOptions/porosity/porousZone | 60 +++++++++++++++++++ 5 files changed, 162 insertions(+) create mode 100644 etc/caseDicts/general/coordinateSystem/cartesianXY create mode 100644 etc/caseDicts/general/coordinateSystem/cartesianXZ create mode 100644 etc/caseDicts/general/coordinateSystem/cartesianYZ create mode 100644 etc/caseDicts/general/coordinateSystem/cylindrical create mode 100644 etc/caseDicts/general/fvOptions/porosity/porousZone diff --git a/etc/caseDicts/general/coordinateSystem/cartesianXY b/etc/caseDicts/general/coordinateSystem/cartesianXY new file mode 100644 index 0000000000..020366c10f --- /dev/null +++ b/etc/caseDicts/general/coordinateSystem/cartesianXY @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object cartesianXY; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type cartesian; +origin (0 0 0); +coordinateRotation +{ + type axesRotation; + e1 $x; + e2 $y; +} + +//************************************************************************* // diff --git a/etc/caseDicts/general/coordinateSystem/cartesianXZ b/etc/caseDicts/general/coordinateSystem/cartesianXZ new file mode 100644 index 0000000000..e1be4c9dd4 --- /dev/null +++ b/etc/caseDicts/general/coordinateSystem/cartesianXZ @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object cartesianXZ; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type cartesian; +origin (0 0 0); +coordinateRotation +{ + type axesRotation; + e1 $x; + e3 $z; +} + +//************************************************************************* // diff --git a/etc/caseDicts/general/coordinateSystem/cartesianYZ b/etc/caseDicts/general/coordinateSystem/cartesianYZ new file mode 100644 index 0000000000..e2def70c32 --- /dev/null +++ b/etc/caseDicts/general/coordinateSystem/cartesianYZ @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object cartesianYZ; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type cartesian; +origin (0 0 0); +coordinateRotation +{ + type axesRotation; + e2 $y; + e3 $z +} + +//************************************************************************* // diff --git a/etc/caseDicts/general/coordinateSystem/cylindrical b/etc/caseDicts/general/coordinateSystem/cylindrical new file mode 100644 index 0000000000..ff5b3559d3 --- /dev/null +++ b/etc/caseDicts/general/coordinateSystem/cylindrical @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object cylindrical; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type cartesian; +coordinateRotation +{ + type localAxesRotation; + e3 $axis; +} + +//************************************************************************* // diff --git a/etc/caseDicts/general/fvOptions/porosity/porousZone b/etc/caseDicts/general/fvOptions/porosity/porousZone new file mode 100644 index 0000000000..393edc6346 --- /dev/null +++ b/etc/caseDicts/general/fvOptions/porosity/porousZone @@ -0,0 +1,60 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object porousZone; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +porousZone // Change to something more descriptive +{ + type explicitPorositySource; + active true; + selectionMode cellZone; + cellZone ; // Specify the name of the cellZone + + explicitPorositySourceCoeffs + { + type DarcyForchheimer; + + DarcyForchheimerCoeffs + { + // Negative coeffs are multiplied by largest positive coeff, + // taking the magnitude, e.g. for -1000, coeff = |1e7*-1000| = 1e10 + + d d [0 -2 0 0 0 0 0] (1e7 -1000 -1000); + f f [0 -1 0 0 0 0 0] (0 0 0); + + coordinateSystem // Cartesian coordinates for the cellZone + { + x (1 0 0); + y (0 1 0); + #includeEtc "caseDicts/general/coordinateSystem/cartesianXY" + } + } + + fixedCoeffCoeffs + { + alpha alpha [0 0 -1 0 0 0 0] (100 -1000 -1000); + beta beta [0 -1 0 0 0 0 0] (0 0 0); + rhoRef 1.205; + + coordinateSystem // Cylindrical coordinates for the cellZone + { + origin (0 0 0); + axis (0 0 1); + #includeEtc "caseDicts/general/coordinateSystem/cylindrical" + } + } + } +} + +//************************************************************************** // From a275e9d7f2d30f53bd46fe45343ef5843746776c Mon Sep 17 00:00:00 2001 From: Chris Greenshields Date: Tue, 11 Aug 2015 14:54:48 +0100 Subject: [PATCH 2/2] porousZone template: removed duplicate name in dimensionedScalars --- etc/caseDicts/general/fvOptions/porosity/porousZone | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/caseDicts/general/fvOptions/porosity/porousZone b/etc/caseDicts/general/fvOptions/porosity/porousZone index 393edc6346..f7ab42ffed 100644 --- a/etc/caseDicts/general/fvOptions/porosity/porousZone +++ b/etc/caseDicts/general/fvOptions/porosity/porousZone @@ -30,8 +30,8 @@ porousZone // Change to something more descriptive // Negative coeffs are multiplied by largest positive coeff, // taking the magnitude, e.g. for -1000, coeff = |1e7*-1000| = 1e10 - d d [0 -2 0 0 0 0 0] (1e7 -1000 -1000); - f f [0 -1 0 0 0 0 0] (0 0 0); + d [0 -2 0 0 0 0 0] (1e7 -1000 -1000); + f [0 -1 0 0 0 0 0] (0 0 0); coordinateSystem // Cartesian coordinates for the cellZone { @@ -43,8 +43,8 @@ porousZone // Change to something more descriptive fixedCoeffCoeffs { - alpha alpha [0 0 -1 0 0 0 0] (100 -1000 -1000); - beta beta [0 -1 0 0 0 0 0] (0 0 0); + alpha [0 0 -1 0 0 0 0] (100 -1000 -1000); + beta [0 -1 0 0 0 0 0] (0 0 0); rhoRef 1.205; coordinateSystem // Cylindrical coordinates for the cellZone