Commit 6adf9536 authored by Mark Olesen's avatar Mark Olesen

Merge branch 'integration-1712' into 'master'

Integration 1712

See merge request !1
parents 8db9df21 423408ef
#!/bin/bash
#SUBMODELS
(cd frictionModels && wclean && rm -rf lnInclude)
(cd entrainmentModels && wclean && rm -rf lnInclude)
#PREPROCESSING
(cd slopeMesh && wclean)
(cd releaseAreaMapping && wclean)
#SOLVER
(cd implicitSolver && wclean)
#CASES
(cd tutorials/simpleslope && ./Allclean)
(cd tutorials/entrainment && ./Allclean)
#!/bin/bash
./Allwmake
#CASES
echo ''
echo 'running case simpleslope'
(cd tutorials/simpleslope && ./Allrun)
echo ''
echo 'running case entrainment'
(cd tutorials/entrainment && ./Allrun)
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
#------------------------------------------------------------------------------
src/Allwclean
wclean -all applications
#------------------------------------------------------------------------------
#!/bin/bash
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
#SUBMODELS
(cd frictionModels && wmake libso)
(cd entrainmentModels && wmake libso)
# Parse arguments for library compilation
if [ -f $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments ]
then . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
fi
#PREPROCESSING
(cd slopeMesh && wmake)
(cd releaseAreaMapping && wmake)
#------------------------------------------------------------------------------
#SOLVER
(cd implicitSolver && wmake)
\ No newline at end of file
src/Allwmake $targetType $*
applications/Allwmake $targetType $*
#------------------------------------------------------------------------------
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
if [ -f $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments ]
then . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
fi
#------------------------------------------------------------------------------
wmake -all $targetType solvers
wmake -all $targetType utilities
#------------------------------------------------------------------------------
......@@ -3,14 +3,10 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/cfdTools/general/lnInclude \
-I$(LIB_SRC)/foam/lnInclude \
-IfrictionModel \
-I. \
-DFULLDEBUG -g -O0 -fpermissive
-I../../../src/avalanche/lnInclude
EXE_LIBS = \
-lfiniteArea \
-lfiniteVolume \
-llduSolvers \
-lfoam
-L$(FOAM_USER_LIBBIN) \
-lfaAvalanche
......@@ -10,5 +10,6 @@ pb += friction->rho()*(g*h)&n;
//pb = fac::average(fac::interpolate(pb));
pb = Foam::max(pb, dimensionedScalar("pb_min", dimensionSet(1, -1, -2, 0, 0, 0, 0), 0));
// Clipping
pb = Foam::max(pb, dimensionedScalar(dimPressure));
......@@ -95,7 +95,7 @@
IOobject::AUTO_WRITE
),
aMesh,
dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0, 0, 0), 0)
dimensionedScalar(dimPressure)
);
areaVectorField pbn
......@@ -109,7 +109,7 @@
IOobject::NO_WRITE
),
aMesh,
dimensionedVector("zero", dimensionSet(1, -1, -2, 0, 0, 0, 0), vector(0, 0, 0))
dimensionedVector(dimPressure)
);
areaVectorField tau
......@@ -123,7 +123,7 @@
IOobject::AUTO_WRITE
),
aMesh,
dimensionedVector("zero", dimensionSet(1, -1, -2, 0, 0, 0, 0), vector(0, 0, 0))
dimensionedVector(dimPressure)
);
//entrainment height
......@@ -138,5 +138,5 @@
IOobject::AUTO_WRITE
),
aMesh,
dimensionedScalar( "zero", dimLength, 0 )
dimensionedScalar(dimLength)
);
......@@ -9,7 +9,7 @@ volVectorField U
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("0", dimVelocity, vector::zero)
dimensionedVector(dimVelocity)
);
volScalarField H
......@@ -23,7 +23,7 @@ volScalarField H
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(0, 1, 0, 0, 0, 0, 0), 0)
dimensionedScalar(dimLength)
);
volScalarField Hentrain
......@@ -37,7 +37,7 @@ volScalarField Hentrain
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(0, 1, 0, 0, 0, 0, 0), 0)
dimensionedScalar(dimLength)
);
volScalarField Pb
......@@ -51,7 +51,7 @@ volScalarField Pb
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0, 0, 0), 0)
dimensionedScalar(dimPressure)
);
volVectorField Tau
......@@ -65,7 +65,7 @@ volVectorField Tau
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("zero", dimensionSet(1, -1, -2, 0, 0, 0, 0), vector::zero)
dimensionedVector(dimPressure)
);
......
......@@ -29,7 +29,8 @@ Description
The solver is based on the Finite Area Method.
Model derivation and description:
Rauter and Tukovic (submitted to Computer & Fluids):
A finite area scheme for shallow granular flows on three-dimensionalc surfaces
A finite area scheme for shallow granular flows on three-dimensional
surfaces
Author
Matthias Rauter matthias.rauter@uibk.ac.at
......
......@@ -38,9 +38,11 @@ scalar meanCoNum = 0.0;
scalar velMag = 0.0;
if (aMesh.nInternalEdges())
{
edgeScalarField edgeSpeed = (xi*fac::interpolate(Us) & aMesh.Le()/aMesh.magLe())
+Foam::sqrt(max(dimensionedScalar("gh_min", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0), fac::interpolate(h)*fac::interpolate(g&n)));
edgeScalarField edgeSpeed
(
(xi*fac::interpolate(Us) & aMesh.Le()/aMesh.magLe())
+ Foam::sqrt(max(dimensionedScalar("gh_min", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0), fac::interpolate(h)*fac::interpolate(g&n)))
);
velMag = max(edgeSpeed.internalField()).value();
......
......@@ -2,15 +2,8 @@ EXE_INC = \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/cfdTools/general/lnInclude \
-I$(LIB_SRC)/foam/lnInclude \
-IfrictionModel \
-I. \
-DFULLDEBUG -g -O0 -fpermissive
-I$(LIB_SRC)/cfdTools/general/lnInclude
EXE_LIBS = \
-lfiniteArea \
-lfiniteVolume \
-llduSolvers \
-lfoam
-lfiniteVolume
......@@ -3,9 +3,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/cfdTools/general/lnInclude \
-DFULLDEBUG -g -O0
-IelevationModels/elevationModel
EXE_LIBS = \
-lfiniteArea \
......
......@@ -76,14 +76,13 @@ protected:
dictionary elevationProperties_;
// Private Member Functions
//- Disallow copy construct
elevationModel(const elevationModel&);
elevationModel(const elevationModel&) = delete;
//- Disallow default bitwise assignment
void operator=(const elevationModel&);
void operator=(const elevationModel&) = delete;
public:
......@@ -129,15 +128,13 @@ public:
);
// Destructor
virtual ~elevationModel()
{}
//- Destructor
virtual ~elevationModel() = default;
// Member Functions
//return the global point X for the local point x
//- Return the global point X for the local point x
virtual vector X(const vector &x) const = 0;
//- Return the elevation properties dictionary
......
......@@ -26,7 +26,9 @@ Author
Matthias Rauter matthias.rauter@uibk.ac.at
\*---------------------------------------------------------------------------*/
#include "SimpleSlope.H"
#include "unitConversion.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -56,12 +58,12 @@ Foam::elevationModels::SimpleSlope::SimpleSlope
b_(elevationProperties_.subDict("SimpleSlopeCoeffs").lookupOrDefault<scalar>("b", 21.5))
{
alpha_ = alpha_/180.*M_PI;
beta_ = beta_/180.*M_PI;
a_ = a_;
alpha_ = degToRad(alpha_);
beta_ = degToRad(beta_);
ab_ = b_-a_;
Info << "Creating simple slope, transfer between " << globalZ(a_) << " and " << globalZ(b_) << endl;
Info<< "Creating simple slope, transfer between "
<< globalZ(a_) << " and " << globalZ(b_) << endl;
}
......@@ -101,6 +103,7 @@ Foam::scalar Foam::elevationModels::SimpleSlope::globalX(scalar x) const
+cos(beta_)*(x-b_);
}
Foam::scalar Foam::elevationModels::SimpleSlope::globalZ(scalar x) const
{
if (x < a_)
......@@ -117,4 +120,6 @@ Foam::scalar Foam::elevationModels::SimpleSlope::globalZ(scalar x) const
+ab_/(alpha_-beta_)*cos(alpha_)
-sin(beta_)*(x-b_);
}
// ************************************************************************* //
......@@ -51,7 +51,6 @@ Author
#include "faMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
......@@ -84,10 +83,10 @@ class SimpleSlope
//length of transition zone
scalar ab_;
scalar globalX(scalar x) const;
scalar globalZ(scalar x) const;
public:
//- Runtime type information
......@@ -104,10 +103,8 @@ public:
);
// Destructor
virtual ~SimpleSlope()
{}
//- Destructor
virtual ~SimpleSlope() = default;
// Member Functions
......
entrainmentModel/entrainmentModel.C
entrainmentModel/newEntrainmentModel.C
depositionModel/depositionModel.C
depositionModel/newDepositionModel.C
entrainmentOff/entrainmentOff.C
Erosionenergy/Erosionenergy.C
Front/Front.C
IsslerFC/IsslerFC.C
Medina/Medina.C
depositionOff/depositionOff.C
Stopingprofile/Stopingprofile.C
LIB = $(FOAM_USER_LIBBIN)/libfaEntrainmentModels
frictionModel/frictionModel.C
frictionModel/newFrictionModel.C
PoliquenForterre/PoliquenForterre.C
muI/muI.C
Voellmy/Voellmy.C
kt/kt.C
DarcyWeisbach/DarcyWeisbach.C
ManningStrickler/ManningStrickler.C
LIB = $(FOAM_USER_LIBBIN)/libfaFrictionModels
EXE_INC = \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/cfdTools/general/lnInclude \
-I$(LIB_SRC)/foam/lnInclude \
-I../frictionModels/lnInclude \
-I../entrainmentModels/lnInclude \
-DFULLDEBUG -g -O0 -fpermissive
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lfaFrictionModels \
-lfaEntrainmentModels \
-lfiniteArea \
-lfiniteVolume
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
wclean avalanche
#------------------------------------------------------------------------------
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
if [ -f $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments ]
then . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
fi
#------------------------------------------------------------------------------
wmake $targetType avalanche
#------------------------------------------------------------------------------
entrainment = entrainmentModels
$(entrainment)/entrainmentModel/entrainmentModel.C
$(entrainment)/entrainmentModel/newEntrainmentModel.C
$(entrainment)/depositionModel/depositionModel.C
$(entrainment)/depositionModel/newDepositionModel.C
$(entrainment)/entrainmentOff/entrainmentOff.C
$(entrainment)/Erosionenergy/Erosionenergy.C
$(entrainment)/Front/Front.C
$(entrainment)/IsslerFC/IsslerFC.C
$(entrainment)/Medina/Medina.C
$(entrainment)/depositionOff/depositionOff.C
$(entrainment)/Stopingprofile/Stopingprofile.C
friction = frictionModels
$(friction)/frictionModel/frictionModel.C
$(friction)/frictionModel/newFrictionModel.C
$(friction)/PoliquenForterre/PoliquenForterre.C
$(friction)/muI/muI.C
$(friction)/Voellmy/Voellmy.C
$(friction)/kt/kt.C
$(friction)/DarcyWeisbach/DarcyWeisbach.C
$(friction)/ManningStrickler/ManningStrickler.C
LIB = $(FOAM_USER_LIBBIN)/libfaAvalanche
......@@ -3,10 +3,9 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/cfdTools/general/lnInclude \
-I./elevationModels/elevationModel \
-DFULLDEBUG -g -O0
-IfrictionModel \
EXE_LIBS = \
-lfiniteArea \
-lfiniteVolume
-lfiniteVolume \
-llduSolvers
......@@ -25,7 +25,8 @@ Class
Foam::entrainmentModels::ErrosionEnergy
Description
An entrainment model following the errosion energy apporach (see Rauter et al. 2016).
An entrainment model following the errosion energy apporach
(see Rauter et al. 2016).
SourceFiles
Erosionenergy.C
......@@ -68,12 +69,12 @@ class Erosionenergy
{
// Private data
//Specific erroision energy parameter e_b
//- Specific erosion energy parameter e_b
dimensionedScalar eb_;
//Pointer to the gravitation fields
const areaVectorField &gs_;
const areaScalarField &gn_;
//- Reference to the gravitation fields
const areaVectorField& gs_;
const areaScalarField& gn_;
public:
......@@ -83,7 +84,7 @@ public:
// Constructors
//- construct from components
//- Construct from components
Erosionenergy
(
const word& name,
......@@ -96,10 +97,8 @@ public:
);
// Destructor
virtual ~Erosionenergy()
{}
//- Destructor
virtual ~Erosionenergy() = default;
// Member Functions
......
......@@ -49,11 +49,11 @@ Foam::entrainmentModels::Front::Front
(
const word& name,
const dictionary& entrainmentProperties,
const areaVectorField &Us,
const areaScalarField &h,
const areaScalarField &hentrain,
const areaScalarField &pb,
const areaVectorField &tau
const areaVectorField& Us,
const areaScalarField& h,
const areaScalarField& hentrain,
const areaScalarField& pb,
const areaVectorField& tau
)
:
entrainmentModel(name, entrainmentProperties, Us, h, hentrain, pb, tau),
......@@ -67,14 +67,16 @@ Foam::entrainmentModels::Front::Front
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::areaScalarField &Foam::entrainmentModels::Front::Sm() const
const Foam::areaScalarField& Foam::entrainmentModels::Front::Sm() const
{
areaScalarField eflag = pos(h_-htrigger_);
const areaScalarField eflag(pos(h_-htrigger_));
Sm_ = eflag*hentrain_/Us_.db().time().deltaT();
return Sm_;
}
bool Foam::entrainmentModels::Front::read
(
const dictionary& entrainmentProperties
......
......@@ -50,7 +50,6 @@ Author
#include "faMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
......@@ -68,7 +67,7 @@ class Front
{
// Private data
//Height threshold
//- Height threshold
dimensionedScalar htrigger_;
......@@ -85,18 +84,16 @@ public:
(
const word& name,
const dictionary& frictionProperties,
const areaVectorField &Us,
const areaScalarField &h,
const areaScalarField &hentrain,
const areaScalarField &pb,
const areaVectorField &tau
const areaVectorField& Us,
const areaScalarField& h,
const areaScalarField& hentrain,
const areaScalarField& pb,
const areaVectorField& tau
);
// Destructor
virtual ~Front()
{}
//- Destructor
virtual ~Front() = default;
// Member Functions
......
......@@ -65,7 +65,6 @@ Foam::entrainmentModels::IsslerFC::IsslerFC
gn_(Us.db().lookupObject<areaScalarField>("gn"))
{
Info << " " << tauc_ << endl << endl;
}
......@@ -74,25 +73,29 @@ Foam::entrainmentModels::IsslerFC::IsslerFC
const Foam::areaScalarField &Foam::entrainmentModels::IsslerFC::Sm() const
{
areaScalarField u = mag(Us_);
areaScalarField gs = mag(gs_);
areaScalarField gamma_c =5./2.*u/h_;
const dimensionedScalar smallVel("small", dimVelocity, SMALL);
const areaScalarField u(mag(Us_));
const areaScalarField gs(mag(gs_));
const areaScalarField gamma_c(5./2.*u/h_);
areaScalarField uthr = h_*gamma_c*gamma_c/2. *
K_*gamma_c/
(
h_*(gs+mu_*gn_)+4.*K_*gamma_c*gamma_c
);
const areaScalarField uthr
(
h_*gamma_c*gamma_c/2.
* K_*gamma_c
/ ( h_*(gs+mu_*gn_)+4.*K_*gamma_c*gamma_c )
);
areaScalarField weinf = (h_*(gs+mu_*gn_)+4*K_*pow(gamma_c,2))/
(
h_*gamma_c+dimensionedScalar("small", dimVelocity, SMALL)
);
const areaScalarField weinf
(
(h_*(gs+mu_*gn_)+4*K_*pow(gamma_c,2))
/ (h_*gamma_c+smallVel)
);
Sm_ = pos(u-uthr)*weinf*(1-uthr/(u+dimensionedScalar("small", dimVelocity, SMALL)));
Sm_ = pos(u-uthr)*weinf*(1-uthr/(u+smallVel));
areaScalarField hlimit = h_*mag(gs_)-(tauc_-5*K_*gamma_c*gamma_c);
areaScalarField hlimit2 = h_-dimensionedScalar("small", dimLength, 1e-2);
const areaScalarField hlimit(h_*mag(gs_)-(tauc_-5*K_*gamma_c*gamma_c));
const areaScalarField hlimit2(h_-dimensionedScalar("small", dimLength, 1e-2));
Sm_ = pos(hlimit2)*pos(hlimit)*Sm_;
......
<
......@@ -68,18 +68,18 @@ class IsslerFC
{
// Private data
//Maximum shear stress tau_c
//- Maximum shear stress tau_c
dimensionedScalar tauc_;
//Kinetic Theory mu
//- Kinetic Theory mu
dimensionedScalar mu_;
//Kinetic Theory K
//- Kinetic Theory K
dimensionedScalar K_;
//Pointer to the gravitation fields
const areaVectorField &gs_;
const areaScalarField &gn_;
//- Reference to the gravitation fields
const areaVectorField& gs_;
const areaScalarField& gn_;
public:
......@@ -89,23 +89,21 @@ public:
// Constructors
//- construct from components
//- Construct from components
IsslerFC
(
const word& name,
const dictionary& frictionProperties,
const areaVectorField &Us,
const areaScalarField &h,
const areaScalarField &hentrain,
const areaScalarField &pb,
const areaVectorField &tau
const areaVectorField& Us,
const areaScalarField& h,
const areaScalarField& hentrain,
const areaScalarField& pb,
const areaVectorField& tau