From 17b2e50e9ce0ea1de058d84a8c69554c1d444a85 Mon Sep 17 00:00:00 2001 From: henry Date: Tue, 17 Feb 2009 17:07:09 +0000 Subject: [PATCH] Added shallowWaterFoam solver and tutorial case. --- .../shallowWaterFoam/CourantNo.H | 66 +++ .../shallowWaterFoam/Make/files | 3 + .../shallowWaterFoam/Make/options | 5 + .../shallowWaterFoam/createFields.H | 74 +++ .../shallowWaterFoam/createPhi.H | 57 +++ .../readEnvironmentalProperties.H | 21 + .../shallowWaterFoam/shallowWaterFoam.C | 165 +++++++ .../shallowWaterFoam/squareBump/.gmtcommands4 | 8 + .../shallowWaterFoam/squareBump/0/U | 44 ++ .../shallowWaterFoam/squareBump/0/h | 448 ++++++++++++++++++ .../shallowWaterFoam/squareBump/0/hTotal | 46 ++ .../constant/environmentalProperties | 21 + .../shallowWaterFoam/squareBump/constant/h0 | 447 +++++++++++++++++ .../constant/polyMesh/blockMeshDict | 74 +++ .../squareBump/constant/polyMesh/boundary | 46 ++ .../squareBump/system/controlDict | 46 ++ .../squareBump/system/fvSchemes | 54 +++ .../squareBump/system/fvSolution | 53 +++ .../squareBump/system/setFieldsDict | 38 ++ 19 files changed, 1716 insertions(+) create mode 100644 applications/solvers/incompressible/shallowWaterFoam/CourantNo.H create mode 100644 applications/solvers/incompressible/shallowWaterFoam/Make/files create mode 100644 applications/solvers/incompressible/shallowWaterFoam/Make/options create mode 100644 applications/solvers/incompressible/shallowWaterFoam/createFields.H create mode 100644 applications/solvers/incompressible/shallowWaterFoam/createPhi.H create mode 100644 applications/solvers/incompressible/shallowWaterFoam/readEnvironmentalProperties.H create mode 100644 applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/.gmtcommands4 create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/0/U create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/0/h create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/0/hTotal create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/constant/environmentalProperties create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/constant/h0 create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/blockMeshDict create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/boundary create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/system/controlDict create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSolution create mode 100644 tutorials/incompressible/shallowWaterFoam/squareBump/system/setFieldsDict diff --git a/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H b/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H new file mode 100644 index 0000000000..125f1b23b5 --- /dev/null +++ b/applications/solvers/incompressible/shallowWaterFoam/CourantNo.H @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + CourantNo + +Description + Calculates and outputs the maximum Courant Number. + +\*---------------------------------------------------------------------------*/ + + +scalar CoNum = 0.0; +scalar meanCoNum = 0.0; +scalar waveCoNum = 0.0; + +if (mesh.nInternalFaces()) +{ + surfaceScalarField SfUfbyDelta = + mesh.surfaceInterpolation::deltaCoeffs() + *mag(phi)/fvc::interpolate(h); + + CoNum = max(SfUfbyDelta/mesh.magSf()) + .value()*runTime.deltaT().value(); + + meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) + .value()*runTime.deltaT().value(); + + // Gravity wave Courant number + waveCoNum = + 0.5*max + ( + mesh.surfaceInterpolation::deltaCoeffs() + *sqrt(fvc::interpolate(h)) + ).value()*sqrt(magg).value()*runTime.deltaT().value(); +} + +Info<< "Courant number mean: " << meanCoNum + << " max: " << CoNum << endl; + +Info<< "Gravity wave Courant number max: " << waveCoNum + << endl; + + +// ************************************************************************* // diff --git a/applications/solvers/incompressible/shallowWaterFoam/Make/files b/applications/solvers/incompressible/shallowWaterFoam/Make/files new file mode 100644 index 0000000000..448878dfc7 --- /dev/null +++ b/applications/solvers/incompressible/shallowWaterFoam/Make/files @@ -0,0 +1,3 @@ +shallowWaterFoam.C + +EXE = $(FOAM_APPBIN)/shallowWaterFoam diff --git a/applications/solvers/incompressible/shallowWaterFoam/Make/options b/applications/solvers/incompressible/shallowWaterFoam/Make/options new file mode 100644 index 0000000000..fa15f12452 --- /dev/null +++ b/applications/solvers/incompressible/shallowWaterFoam/Make/options @@ -0,0 +1,5 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lfiniteVolume diff --git a/applications/solvers/incompressible/shallowWaterFoam/createFields.H b/applications/solvers/incompressible/shallowWaterFoam/createFields.H new file mode 100644 index 0000000000..cfc14216f7 --- /dev/null +++ b/applications/solvers/incompressible/shallowWaterFoam/createFields.H @@ -0,0 +1,74 @@ +Info<< "Reading field h\n" << endl; +volScalarField h +( + IOobject + ( + "h", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh +); + +Info<< "Reading field h0 if present\n" << endl; +volScalarField h0 +( + IOobject + ( + "h0", + runTime.findInstance("polyMesh", "points"), + mesh, + IOobject::READ_IF_PRESENT + ), + mesh, + dimensionedScalar("h0", dimLength, 0.0) +); + +Info<< "Reading field U\n" << endl; +volVectorField U +( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh +); + +Info<< "Creating field hU\n" << endl; +volVectorField hU +( + IOobject + ( + "hU", + runTime.timeName(), + mesh + ), + h*U, + U.boundaryField().types() +); + +Info<< "Creating field hTotal for post processing\n" << endl; +volScalarField hTotal +( + IOobject + ( + "hTotal", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + h+h0 +); +hTotal.write(); + +# include "createPhi.H" + +Info<< "Creating Coriolis Force" << endl; +const dimensionedVector F("F", ((2.0*Omega) & gHat)*gHat); diff --git a/applications/solvers/incompressible/shallowWaterFoam/createPhi.H b/applications/solvers/incompressible/shallowWaterFoam/createPhi.H new file mode 100644 index 0000000000..0c79ffdc34 --- /dev/null +++ b/applications/solvers/incompressible/shallowWaterFoam/createPhi.H @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + createPhi + +Description + Creates and initialises the face-flux field phi. + +\*---------------------------------------------------------------------------*/ + +#ifndef createPhi_H +#define createPhi_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Info<< "Reading/calculating face flux field phi\n" << endl; + +surfaceScalarField phi +( + IOobject + ( + "phi", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + linearInterpolate(hU) & mesh.Sf() +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/incompressible/shallowWaterFoam/readEnvironmentalProperties.H b/applications/solvers/incompressible/shallowWaterFoam/readEnvironmentalProperties.H new file mode 100644 index 0000000000..866335eef1 --- /dev/null +++ b/applications/solvers/incompressible/shallowWaterFoam/readEnvironmentalProperties.H @@ -0,0 +1,21 @@ +Info<< "\nReading environmentalProperties" << endl; + +IOdictionary environmentalProperties +( + IOobject + ( + "environmentalProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) +); + +const dimensionedVector g(environmentalProperties.lookup("g")); +const Switch rotating(environmentalProperties.lookup("rotating")); +const dimensionedVector Omega = + rotating ? environmentalProperties.lookup("Omega") + : dimensionedVector("Omega", -dimTime, vector(0,0,0)); +const dimensionedScalar magg = mag(g); +const dimensionedVector gHat = g/magg; diff --git a/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C b/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C new file mode 100644 index 0000000000..5a031c6352 --- /dev/null +++ b/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C @@ -0,0 +1,165 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + shallowWaterFoam + +Description + Transient solver for inviscid shallow-water equations with rotation. + If the geometry is 3D then it is assumed to be one layers of cells and the + component of the velocity normal to gravity is removed. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + runTime++; + + Info<< "\n Time = " << runTime.timeName() << nl << endl; + + #include "readPISOControls.H" + #include "CourantNo.H" + + for (int ucorr=0; ucorr +400 +( +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.009 +0.009 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.009 +0.009 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +0.01 +) +; + +boundaryField +{ + sides + { + type zeroGradient; + } + inlet + { + type zeroGradient; + } + outlet + { + type fixedValue; + value uniform 0.01; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/0/hTotal b/tutorials/incompressible/shallowWaterFoam/squareBump/0/hTotal new file mode 100644 index 0000000000..fdaf7b1916 --- /dev/null +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/0/hTotal @@ -0,0 +1,46 @@ +/*--------------------------------*- 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 volScalarField; + location "0"; + object hTotal; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 0 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + sides + { + type calculated; + value uniform 0.01; + } + inlet + { + type calculated; + value uniform 0.01; + } + outlet + { + type calculated; + value uniform 0.01; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/constant/environmentalProperties b/tutorials/incompressible/shallowWaterFoam/squareBump/constant/environmentalProperties new file mode 100644 index 0000000000..8188039832 --- /dev/null +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/constant/environmentalProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object environmentalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +g g [0 1 -2 0 0 0 0] (0 0 -9.81); +rotating true; +Omega Omega [0 0 -1 0 0] (0 0 7.292e-5); + +// ************************************************************************* // diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/constant/h0 b/tutorials/incompressible/shallowWaterFoam/squareBump/constant/h0 new file mode 100644 index 0000000000..e89398d19f --- /dev/null +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/constant/h0 @@ -0,0 +1,447 @@ +/*--------------------------------*- 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 volScalarField; + location "0"; + object h0; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 0 0 0 0 0]; + +internalField nonuniform List +400 +( +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0.001 +0.001 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0.001 +0.001 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +) +; + +boundaryField +{ + sides + { + type zeroGradient; + } + inlet + { + type zeroGradient; + } + outlet + { + type zeroGradient; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/blockMeshDict b/tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000..47585411fb --- /dev/null +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/blockMeshDict @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (0 0 0) + (1 0 0) + (1 1 0) + (0 1 0) + (0 0 0.1) + (1 0 0.1) + (1 1 0.1) + (0 1 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + patch sides + ( + (3 7 6 2) + (1 5 4 0) + ) + patch inlet + ( + (0 4 7 3) + ) + patch outlet + ( + (2 6 5 1) + ) + empty frontAndBack + ( + (0 3 2 1) + (4 5 6 7) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/boundary b/tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/boundary new file mode 100644 index 0000000000..b96b8676fd --- /dev/null +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/boundary @@ -0,0 +1,46 @@ +/*--------------------------------*- 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 polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + sides + { + type patch; + nFaces 40; + startFace 760; + } + inlet + { + type patch; + nFaces 20; + startFace 800; + } + outlet + { + type patch; + nFaces 20; + startFace 820; + } + frontAndBack + { + type empty; + nFaces 800; + startFace 840; + } +) + +// ************************************************************************* // diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/system/controlDict b/tutorials/incompressible/shallowWaterFoam/squareBump/system/controlDict new file mode 100644 index 0000000000..0dee06d265 --- /dev/null +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/system/controlDict @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 100; + +deltaT 0.1; + +writeControl runTime; + +writeInterval 1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable no; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes new file mode 100644 index 0000000000..801048918a --- /dev/null +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default CrankNicholson 0.9; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phiv,hU) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + +fluxRequired +{ + h; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSolution b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSolution new file mode 100644 index 0000000000..832feefee4 --- /dev/null +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSolution @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + h + { + solver PCG; + preconditioner DIC; + tolerance 1e-6; + relTol 0.01; + }; + + hFinal + { + solver PCG; + preconditioner DIC; + tolerance 1e-8; + relTol 0; + }; + + hU + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } +} + +PISO +{ + nOuterCorrectors 3; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + + momentumPredictor yes; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/system/setFieldsDict b/tutorials/incompressible/shallowWaterFoam/squareBump/system/setFieldsDict new file mode 100644 index 0000000000..83d7994c33 --- /dev/null +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/system/setFieldsDict @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue h0 0 + volScalarFieldValue h 0.01 + volVectorFieldValue U (0.1 0 0) +); + +regions +( + boxToCell + { + box (0.45 0.45 0) (0.55 0.55 0.1); + + fieldValues + ( + volScalarFieldValue h0 0.001 + volScalarFieldValue h 0.009 + ); + } +); + +// ************************************************************************* //