Skip to content
Snippets Groups Projects
Commit 4d6a3e0c authored by Ned Coltman's avatar Ned Coltman
Browse files

Merge branch 'feature/navier_stokes_ctd' into 'master'

Navier slip condition as an option for interface condition

Closes #9

See merge request !14
parents f9f54f0e 3c154735
No related branches found
No related tags found
1 merge request!14Navier slip condition as an option for interface condition
Showing with 3145 additions and 3 deletions
...@@ -29,7 +29,8 @@ NumericDifference.BaseEpsilon = 1e-8 ...@@ -29,7 +29,8 @@ NumericDifference.BaseEpsilon = 1e-8
[Darcy] [Darcy]
Problem.Name = darcy Problem.Name = darcy
SpatialParams.Permeability = 1e-4 SpatialParams.Permeability = 1e-4
SpatialParams.AlphaBeaversJoseph = 1.0 SpatialParams.Porosity = 1.0
SpatialParams.NavierSlipLength = 0.01
[Vtk] [Vtk]
WriteFaceData = false WriteFaceData = false
......
...@@ -110,7 +110,7 @@ public: ...@@ -110,7 +110,7 @@ public:
{ {
values.setCouplingNeumann(Indices::conti0EqIdx); values.setCouplingNeumann(Indices::conti0EqIdx);
values.setCouplingNeumann(scvf.directionIndex()); values.setCouplingNeumann(scvf.directionIndex());
values.setBeaversJoseph(1 - scvf.directionIndex()); values.setNavierSlip(1 - scvf.directionIndex());
} }
else else
values.setAllSymmetry(); values.setAllSymmetry();
...@@ -176,6 +176,10 @@ public: ...@@ -176,6 +176,10 @@ public:
Scalar alphaBJ(const SubControlVolumeFace& scvf) const Scalar alphaBJ(const SubControlVolumeFace& scvf) const
{ return couplingManager().problem(CouplingManager::darcyIdx).spatialParams().beaversJosephCoeffAtPos(scvf.center()); } { return couplingManager().problem(CouplingManager::darcyIdx).spatialParams().beaversJosephCoeffAtPos(scvf.center()); }
//! Returns the slip length value required as a parameter for the Navier-Slip boundary condition
Scalar navierSlipLength(const SubControlVolumeFace& scvf) const
{ return couplingManager().problem(CouplingManager::darcyIdx).spatialParams().navierSlipLengthAtPos(scvf.center()); }
//! Set the coupling manager //! Set the coupling manager
void setCouplingManager(std::shared_ptr<CouplingManager> cm) void setCouplingManager(std::shared_ptr<CouplingManager> cm)
{ couplingManager_ = cm; } { couplingManager_ = cm; }
......
...@@ -56,6 +56,8 @@ public: ...@@ -56,6 +56,8 @@ public:
{ {
permeability_ = getParam<Scalar>("Darcy.SpatialParams.Permeability"); permeability_ = getParam<Scalar>("Darcy.SpatialParams.Permeability");
alphaBJ_ = getParam<Scalar>("Darcy.SpatialParams.AlphaBeaversJoseph"); alphaBJ_ = getParam<Scalar>("Darcy.SpatialParams.AlphaBeaversJoseph");
porosity_ = getParam<Scalar>("Darcy.SpatialParams.Porosity");
navierSlipLength_ = getParam<Scalar>("Darcy.SpatialParams.NavierSlipLength");
} }
/*! /*!
...@@ -72,7 +74,7 @@ public: ...@@ -72,7 +74,7 @@ public:
* \param globalPos The global position * \param globalPos The global position
*/ */
Scalar porosityAtPos(const GlobalPosition& globalPos) const Scalar porosityAtPos(const GlobalPosition& globalPos) const
{ return 0.4; } { return porosity_; }
/*! \brief Defines the Beavers-Joseph coefficient in [-]. /*! \brief Defines the Beavers-Joseph coefficient in [-].
* *
...@@ -81,10 +83,18 @@ public: ...@@ -81,10 +83,18 @@ public:
Scalar beaversJosephCoeffAtPos(const GlobalPosition& globalPos) const Scalar beaversJosephCoeffAtPos(const GlobalPosition& globalPos) const
{ return alphaBJ_; } { return alphaBJ_; }
/*! \brief Defines the Navier-Slip coefficient in [-].
*
* \param globalPos The global position
*/
Scalar navierSlipLengthAtPos(const GlobalPosition& globalPos) const
{ return navierSlipLength_; }
private: private:
Scalar permeability_; Scalar permeability_;
Scalar alphaBJ_; Scalar alphaBJ_;
Scalar porosity_;
Scalar navierSlipLength_;
}; };
} // end namespace Dumux } // end namespace Dumux
......
#install headers
install(
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/)
#install headers
install(FILES
boundarytypes.hh problem.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/navierstokes/)
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program 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. *
* *
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
* \ingroup NavierStokesModel
* \copydoc Dumux::NavierStokesBoundaryTypes
*/
#ifndef FREEFLOW_NAVIERSTOKES_BOUNDARY_TYPES_HH
#define FREEFLOW_NAVIERSTOKES_BOUNDARY_TYPES_HH
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/typetraits/typetraits.hh>
namespace Dumux {
/*!
* \ingroup NavierStokesModel
* \brief Class to specify the type of a boundary condition for the Navier-Stokes model.
*/
template <int numEq>
class NavierStokesBoundaryTypes : public BoundaryTypes<numEq>
{
using ParentType = BoundaryTypes<numEq>;
public:
NavierStokesBoundaryTypes()
{
for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
resetEq(eqIdx);
}
/*!
* \brief Reset the boundary types for one equation.
*/
void resetEq(const int eqIdx)
{
ParentType::resetEq(eqIdx);
boundaryInfo_[eqIdx].isSymmetry = false;
boundaryInfo_[eqIdx].isBeaversJoseph = false;
boundaryInfo_[eqIdx].isOutflow = false;
boundaryInfo_[eqIdx].isNavierSlip = false;
}
/*!
* \brief Sets a symmetry boundary condition for all equations
*/
void setAllSymmetry()
{
for (int eqIdx=0; eqIdx < numEq; ++eqIdx)
{
resetEq(eqIdx);
boundaryInfo_[eqIdx].isSymmetry = true;
}
}
/*!
* \brief Returns true if the there is a symmetry boundary condition
*/
bool isSymmetry() const
{ return boundaryInfo_[0].isSymmetry; }
/*!
* \brief Prevent setting all boundary conditions to Dirichlet.
*/
template<class T = void>
void setAllDirichlet()
{
static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Dirichlet not permitted!");
}
/*!
* \brief Prevent setting all boundary conditions to Neumann.
*/
template<class T = void>
void setAllNeumann()
{
static_assert(AlwaysFalse<T>::value, "Setting all boundary types to Neumann not permitted!");
}
/*!
* \brief Set a boundary condition for a single equation to
* Beavers-Joseph(-Saffmann) (special case of Dirichlet b.c.).
*/
void setBeaversJoseph(const int eqIdx)
{
resetEq(eqIdx);
boundaryInfo_[eqIdx].isBeaversJoseph = true;
}
/*!
* \brief Returns true if an equation is used to specify a
* Beavers-Joseph(-Saffman) boundary condition.
*
* \param eqIdx The index of the equation
*/
bool isBeaversJoseph(const int eqIdx) const
{ return boundaryInfo_[eqIdx].isBeaversJoseph; }
/*!
* \brief Returns true if some equation is used to specify a
* Beavers-Joseph(-Saffman) boundary condition.
*/
bool hasBeaversJoseph() const
{
for (int i = 0; i < numEq; ++i)
if (boundaryInfo_[i].isBeaversJoseph)
return true;
return false;
}
/*!
* \brief Set a boundary condition for a single equation to
* Beavers-Joseph(-Saffmann) (special case of Dirichlet b.c.).
*/
void setNavierSlip(const int eqIdx)
{
resetEq(eqIdx);
boundaryInfo_[eqIdx].isNavierSlip = true;
}
/*!
* \brief Returns true if an equation is used to specify a
* Beavers-Joseph(-Saffman) boundary condition.
*
* \param eqIdx The index of the equation
*/
bool isNavierSlip(const int eqIdx) const
{ return boundaryInfo_[eqIdx].isNavierSlip; }
/*!
* \brief Returns true if some equation is used to specify a
* Beavers-Joseph(-Saffman) boundary condition.
*/
bool hasNavierSlip() const
{
for (int i = 0; i < numEq; ++i)
if (boundaryInfo_[i].isNavierSlip)
return true;
return false;
}
/*!
* \brief Set an outflow boundary condition
*/
void setOutflow(const int eqIdx)
{
resetEq(eqIdx);
boundaryInfo_[eqIdx].isOutflow = true;
}
/*!
* \brief Returns true if an outflow boundary condition was set
* \param eqIdx The index of the equation
*/
bool isOutflow(const int eqIdx) const
{ return boundaryInfo_[eqIdx].isOutflow; }
/*!
* \brief Returns true if some equation has an outflow boundary condition
*/
bool hasOutflow() const
{
for (int i = 0; i < numEq; ++i)
if (boundaryInfo_[i].isOutflow)
return true;
return false;
}
protected:
//! use bitfields to minimize the size
struct NavierStokesBoundaryInfo
{
bool isSymmetry : 1;
bool isOutflow : 1;
bool isBeaversJoseph : 1;
bool isNavierSlip : 1;
};
std::array<NavierStokesBoundaryInfo, numEq> boundaryInfo_;
};
} // end namespace Dumux
#endif
This diff is collapsed.
#install headers
install(FILES
fluxvariables.hh velocitygradients.hh staggeredupwindhelper.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/navierstokes/staggered/)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment