Commit 0013a72f authored by Matti Rauter's avatar Matti Rauter Committed by Mark Olesen

Initial commit of avalaches code for OpenFOAM-1712

parents
#!/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/bash
#SUBMODELS
(cd frictionModels && wmake libso)
(cd entrainmentModels && wmake libso)
#PREPROCESSING
(cd slopeMesh && wmake)
(cd releaseAreaMapping && wmake)
#SOLVER
(cd implicitSolver && wmake)
\ No newline at end of file
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | faSavageHutterFOAM
\\ / A nd | Copyright (C) 2017 Matthias Rauter
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Author
Matthias Rauter matthias.rauter@uibk.ac.at
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "faCFD.H"
#include "Erosionenergy.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace entrainmentModels
{
defineTypeNameAndDebug(Erosionenergy, 0);
addToRunTimeSelectionTable(entrainmentModel, Erosionenergy, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::entrainmentModels::Erosionenergy::Erosionenergy
(
const word& name,
const dictionary& entrainmentProperties,
const areaVectorField &Us,
const areaScalarField &h,
const areaScalarField &hentrain,
const areaScalarField &pb,
const areaVectorField &tau
)
:
entrainmentModel(name, entrainmentProperties, Us, h, hentrain, pb, tau),
eb_(entrainmentProperties.subDict("ErosionenergyCoeffs").lookup("eb")),
gs_(Us_.db().lookupObject<areaVectorField>("gs")),
gn_(Us_.db().lookupObject<areaScalarField>("gn"))
{
Info << " " << eb_ << endl << endl;
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::areaScalarField &Foam::entrainmentModels::Erosionenergy::Sm() const
{
Sm_ = (tau_&Us_)/eb_/rho_;
Sm_ = min(Sm_, hentrain_/Us_.db().time().deltaT());
return Sm_;
}
bool Foam::entrainmentModels::Erosionenergy::read
(
const dictionary& entrainmentProperties
)
{
entrainmentModel::read(entrainmentProperties);
entrainmentProperties_.lookup("eb") >> eb_;
return true;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | faSavageHutterFOAM
\\ / A nd | Copyright (C) 2017 Matthias Rauter
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::entrainmentModels::ErrosionEnergy
Description
An entrainment model following the errosion energy apporach (see Rauter et al. 2016).
SourceFiles
Erosionenergy.C
Author
Matthias Rauter matthias.rauter@uibk.ac.at
\*---------------------------------------------------------------------------*/
#ifndef Erosionenergy_H
#define Erosionenergy_H
#include "entrainmentModel.H"
#include "dimensionedScalar.H"
#include "volFields.H"
#include "IOdictionary.H"
#include "typeInfo.H"
#include "runTimeSelectionTables.H"
#include "dimensionedScalar.H"
#include "tmp.H"
#include "autoPtr.H"
#include "faMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace entrainmentModels
{
/*---------------------------------------------------------------------------*\
Class Erosionenergy Declaration
\*---------------------------------------------------------------------------*/
class Erosionenergy
:
public entrainmentModel
{
// Private data
//Specific erroision energy parameter e_b
dimensionedScalar eb_;
//Pointer to the gravitation fields
const areaVectorField &gs_;
const areaScalarField &gn_;
public:
//- Runtime type information
TypeName("Erosionenergy");
// Constructors
//- construct from components
Erosionenergy
(
const word& name,
const dictionary& frictionProperties,
const areaVectorField &Us,
const areaScalarField &h,
const areaScalarField &hentrain,
const areaScalarField &pb,
const areaVectorField &tau
);
// Destructor
virtual ~Erosionenergy()
{}
// Member Functions
//- Return the Source by entrainment
virtual const areaScalarField &Sm() const;
//- Read entrainmentProperties dictionary
virtual bool read(const dictionary& entrainmentProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace frictionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | faSavageHutterFOAM
\\ / A nd | Copyright (C) 2017 Matthias Rauter
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Author
Matthias Rauter matthias.rauter@uibk.ac.at
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "faCFD.H"
#include "Front.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace entrainmentModels
{
defineTypeNameAndDebug(Front, 0);
addToRunTimeSelectionTable(entrainmentModel, Front, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
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
)
:
entrainmentModel(name, entrainmentProperties, Us, h, hentrain, pb, tau),
htrigger_(entrainmentProperties.subDict("FrontCoeffs").lookup("htrigger"))
{
Info << " " << htrigger_ << endl << endl;
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::areaScalarField &Foam::entrainmentModels::Front::Sm() const
{
areaScalarField eflag = pos(h_-htrigger_);
Sm_ = eflag*hentrain_/Us_.db().time().deltaT();
return Sm_;
}
bool Foam::entrainmentModels::Front::read
(
const dictionary& entrainmentProperties
)
{
entrainmentModel::read(entrainmentProperties);
entrainmentProperties_.lookup("htrigger") >> htrigger_;
return true;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | faSavageHutterFOAM
\\ / A nd | Copyright (C) 2017 Matthias Rauter
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::entrainmentModels::Front
Description
An entrainment model following the simple front entrainment approach.
SourceFiles
Front.C
Author
Matthias Rauter matthias.rauter@uibk.ac.at
\*---------------------------------------------------------------------------*/
#ifndef Front_H
#define Front_H
#include "entrainmentModel.H"
#include "dimensionedScalar.H"
#include "volFields.H"
#include "IOdictionary.H"
#include "typeInfo.H"
#include "runTimeSelectionTables.H"
#include "dimensionedScalar.H"
#include "tmp.H"
#include "autoPtr.H"
#include "faMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace entrainmentModels
{
/*---------------------------------------------------------------------------*\
Class Front Declaration
\*---------------------------------------------------------------------------*/
class Front
:
public entrainmentModel
{
// Private data
//Height threshold
dimensionedScalar htrigger_;
public:
//- Runtime type information
TypeName("Front");
// Constructors
//- construct from components
Front
(
const word& name,
const dictionary& frictionProperties,
const areaVectorField &Us,
const areaScalarField &h,
const areaScalarField &hentrain,
const areaScalarField &pb,
const areaVectorField &tau
);
// Destructor
virtual ~Front()
{}
// Member Functions
//- Return the Source by entrainment
virtual const areaScalarField &Sm() const;
//- Read entrainmentProperties dictionary
virtual bool read(const dictionary& entrainmentProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace frictionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | faSavageHutterFOAM
\\ / A nd | Copyright (C) 2017 Matthias Rauter
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Author
Matthias Rauter matthias.rauter@uibk.ac.at
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "faCFD.H"
#include "IsslerFC.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace entrainmentModels
{
defineTypeNameAndDebug(IsslerFC, 0);
addToRunTimeSelectionTable(entrainmentModel, IsslerFC, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::entrainmentModels::IsslerFC::IsslerFC
(
const word& name,
const dictionary& entrainmentProperties,
const areaVectorField &Us,
const areaScalarField &h,
const areaScalarField &hentrain,
const areaScalarField &pb,
const areaVectorField &tau
)
:
entrainmentModel(name, entrainmentProperties, Us, h, hentrain, pb, tau),
tauc_(entrainmentProperties.subDict("IsslerFCCoeffs").lookup("tauc")),
mu_(entrainmentProperties.subDict("IsslerFCCoeffs").lookup("mu")),
K_(entrainmentProperties.subDict("IsslerFCCoeffs").lookup("K")),
gs_(Us.db().lookupObject<areaVectorField>("gs")),
gn_(Us.db().lookupObject<areaScalarField>("gn"))
{
Info << " " << tauc_ << endl << endl;
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::areaScalarField &Foam::entrainmentModels::IsslerFC::Sm() const
{
areaScalarField u = mag(Us_);
areaScalarField gs = mag(gs_);
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
);
areaScalarField weinf = (h_*(gs+mu_*gn_)+4*K_*pow(gamma_c,2))/
(
h_*gamma_c+dimensionedScalar("small", dimVelocity, SMALL)
);
Sm_ = pos(u-uthr)*weinf*(1-uthr/(u+dimensionedScalar("small", dimVelocity, SMALL)));
areaScalarField hlimit = h_*mag(gs_)-(tauc_-5*K_*gamma_c*gamma_c);
areaScalarField hlimit2 = h_-dimensionedScalar("small", dimLength, 1e-2);
Sm_ = pos(hlimit2)*pos(hlimit)*Sm_;
Sm_ = min(Sm_, hentrain_/Us_.db().time().deltaT());
Info << "IsslerFC:min/max(Sm) = " << min(Sm_) << " / " << max(Sm_) << endl;
return Sm_;
}
bool Foam::entrainmentModels::IsslerFC::read
(
const dictionary& entrainmentProperties
)
{
entrainmentModel::read(entrainmentProperties);
entrainmentProperties_.lookup("tauc") >> tauc_;
return true;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | faSavageHutterFOAM
\\ / A nd | Copyright (C) 2017 Matthias Rauter
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::entrainmentModels::IsslerFC
Description
An deposition model following the approach of Isser (2014).
SourceFiles
IsslerFC.C
Author
Matthias Rauter matthias.rauter@uibk.ac.at
\*---------------------------------------------------------------------------*/
#ifndef IsslerFC_H
#define IsslerFC_H
#include "entrainmentModel.H"
#include "dimensionedScalar.H"
#include "volFields.H"
#include "IOdictionary.H"
#include "typeInfo.H"
#include "runTimeSelectionTables.H"
#include "dimensionedScalar.H"
#include "tmp.H"
#include "autoPtr.H"
#include "faMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace entrainmentModels
{
/*---------------------------------------------------------------------------*\
Class IsslerFC Declaration
\*---------------------------------------------------------------------------*/
class IsslerFC
:
public entrainmentModel
{
// Private data
//Maximum shear stress tau_c
dimensionedScalar tauc_;
//Kinetic Theory mu
dimensionedScalar mu_;
//Kinetic Theory K
dimensionedScalar K_;
//Pointer to the gravitation fields
const areaVectorField &gs_;
const areaScalarField &gn_;
public:
//- Runtime type information
TypeName("IsslerFC");
// Constructors
//- 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
);
// Destructor
virtual ~IsslerFC()
{}
// Member Functions
//- Return the Source by entrainment