Commit 4157822c authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[staggered] Introduce FreeFlow TypeTag

* do some clean-up
parent 7fec595c
......@@ -87,19 +87,6 @@ public:
typedef Dumux::CCSubControlVolume<ScvGeometry, IndexType> type;
};
// SET_PROP(StaggeredModel, SubControlVolumeFace)
// {
// private:
// using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
// using Scalar = typename GridView::ctype;
// static const int dim = GridView::dimension;
// static const int dimWorld = GridView::dimensionworld;
// using ScvfGeometry = Dune::MultiLinearGeometry<Scalar, dim-1, dimWorld>;
// using IndexType = typename GridView::IndexSet::IndexType;
// public:
// using type = BoxSubControlVolumeFace<ScvfGeometry, IndexType>;
// };
SET_TYPE_PROP(StaggeredModel, GlobalFaceVars, Dumux::StaggeredGlobalFaceVariables<TypeTag>);
//! Set the default for the ElementBoundaryTypes
......
......@@ -18,66 +18,45 @@
*****************************************************************************/
/*!
* \ingroup Properties
* \ingroup ImplicitProperties
* \ingroup NavierStokesModel
* \file
*
* \brief Defines the properties required for the one-phase fully implicit model.
* \brief Defines a type tag and some properties for free flow models.
*/
#ifndef DUMUX_NAVIERSTOKES_PROPERTY_DEFAULTS_HH
#define DUMUX_NAVIERSTOKES_PROPERTY_DEFAULTS_HH
#include "properties.hh"
#include "model.hh"
#include "volumevariables.hh"
#include "indices.hh"
#include "problem.hh"
#include "localresidual.hh"
#include "fluxvariables.hh"
#include "fluxvariablescache.hh"
#include "velocityoutput.hh"
#include "vtkoutputfields.hh"
#include "boundarytypes.hh"
#include <dumux/implicit/staggered/localresidual.hh>
#include <dumux/freeflow/staggeredni/localresidual.hh>
#include <dumux/freeflow/staggeredni/fluxvariables.hh>
#include <dumux/material/fluidsystems/gasphase.hh>
#include <dumux/material/fluidsystems/liquidphase.hh>
#include <dumux/material/components/nullcomponent.hh>
#include <dumux/material/fluidsystems/1p.hh>
#ifndef DUMUX_FREE_FLOW_PROPERTIES_HH
#define DUMUX_FREE_FLOW_PROPERTIES_HH
#include <dumux/io/vtkoutputmodule.hh>
// #include <dumux/FreeFlow/implicit/fluxvariables.hh>
// #include <dumux/FreeFlow/implicit/fluxvariablescache.hh>
// #include <dumux/FreeFlow/nonisothermal/implicit/localresidual.hh>
// #include <dumux/FreeFlow/compositional/primaryvariableswitch.hh>
// #include <dumux/FreeFlow/implicit/velocityoutput.hh>
// #include <dumux/discretization/darcyslaw.hh>
// #include <dumux/discretization/fickslaw.hh>
// #include <dumux/discretization/fourierslaw.hh>
#include <dumux/discretization/staggered/freeflow/staggeredgeometryhelper.hh>
#include <dumux/discretization/staggered/freeflow/subcontrolvolumeface.hh>
#include <dumux/discretization/staggered/freeflow/facevariables.hh>
#include <dumux/implicit/staggered/primaryvariables.hh>
#include "./staggered/boundarytypes.hh"
namespace Dumux
{
namespace Properties
{
// forward declaration
NEW_PROP_TAG(FluxVariables);
NEW_PROP_TAG(FluxVariablesCache);
NEW_PROP_TAG(StaggeredGeometryHelper);
}
// \{
///////////////////////////////////////////////////////////////////////////
// default property values for the isothermal single phase model
///////////////////////////////////////////////////////////////////////////
namespace Properties {
SET_INT_PROP(NavierStokes, NumEqCellCenter, 1); //!< set the number of equations to 1
SET_INT_PROP(NavierStokes, NumEqFace, 1); //!< set the number of equations to 1
SET_INT_PROP(NavierStokes, NumPhases, 1); //!< The number of phases in the 1p model is 1
//! Type tag for models involving flow in porous media
NEW_TYPE_TAG(FreeFlow);
SET_INT_PROP(FreeFlow, NumEqFace, 1); //!< set the number of equations to 1
//! The sub-controlvolume face
SET_PROP(NavierStokes, SubControlVolumeFace)
SET_PROP(FreeFlow, SubControlVolumeFace)
{
private:
using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
......@@ -88,7 +67,7 @@ public:
};
//! The geometry helper required for the stencils, etc.
SET_PROP(NavierStokes, StaggeredGeometryHelper)
SET_PROP(FreeFlow, StaggeredGeometryHelper)
{
private:
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
......@@ -97,80 +76,10 @@ public:
};
//! The variables living on the faces
SET_TYPE_PROP(NavierStokes, FaceVariables, StaggeredFaceVariables<TypeTag>);
//! The local residual function
SET_TYPE_PROP(NavierStokes, LocalResidual, StaggeredNavierStokesResidual<TypeTag>);
//! the VolumeVariables property
SET_TYPE_PROP(NavierStokes, VolumeVariables, NavierStokesVolumeVariables<TypeTag>);
//! The class that contains the different flux variables (i.e. darcy, diffusion, energy)
//! by default, we set the flux variables to ones for porous media
SET_TYPE_PROP(NavierStokes, FluxVariables, FreeFlowFluxVariables<TypeTag>);
//! The flux variables cache class, by default the one for porous media
SET_TYPE_PROP(NavierStokes, FluxVariablesCache, FreeFlowFluxVariablesCache<TypeTag>);
//! Enable advection
SET_BOOL_PROP(NavierStokes, EnableAdvection, true);
//! The one-phase model has no molecular diffusion
SET_BOOL_PROP(NavierStokes, EnableMolecularDiffusion, false);
//! The indices required by the isothermal single-phase model
SET_TYPE_PROP(NavierStokes, Indices, NavierStokesCommonIndices<TypeTag>);
//! The weight of the upwind control volume when calculating
//! fluxes. Use central differences by default.
SET_SCALAR_PROP(NavierStokes, ImplicitMassUpwindWeight, 0.5);
SET_TYPE_PROP(FreeFlow, FaceVariables, StaggeredFaceVariables<TypeTag>);
//! weight for the upwind mobility in the velocity calculation
//! fluxes. Use central differences by default.
SET_SCALAR_PROP(NavierStokes, ImplicitMobilityUpwindWeight, 0.5);
//! The fluid system to use by default
SET_TYPE_PROP(NavierStokes, FluidSystem, Dumux::FluidSystems::OneP<typename GET_PROP_TYPE(TypeTag, Scalar), typename GET_PROP_TYPE(TypeTag, Fluid)>);
SET_PROP(NavierStokes, Fluid)
{ private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
typedef FluidSystems::LiquidPhase<Scalar, Dumux::NullComponent<Scalar> > type;
};
/*!
* \brief The fluid state which is used by the volume variables to
* store the thermodynamic state. This should be chosen
* appropriately for the model ((non-)isothermal, equilibrium, ...).
* This can be done in the problem.
*/
SET_PROP(NavierStokes, FluidState){
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
public:
typedef Dumux::ImmiscibleFluidState<Scalar, FluidSystem> type;
};
// disable velocity output by default
SET_BOOL_PROP(NavierStokes, VtkAddVelocity, true);
SET_TYPE_PROP(NavierStokes, VtkOutputFields, NavierStokesVtkOutputFields<TypeTag>);
// enable gravity by default
SET_BOOL_PROP(NavierStokes, ProblemEnableGravity, true);
SET_BOOL_PROP(NavierStokes, EnableInertiaTerms, true);
SET_BOOL_PROP(NavierStokes, EnableEnergyTransport, false);
SET_BOOL_PROP(NavierStokes, EnableComponentTransport, false);
//! Normalize the pressure term in the momentum balance or not
SET_BOOL_PROP(NavierStokes, NormalizePressure, true);
SET_PROP(NavierStokes, BoundaryValues)
SET_PROP(FreeFlow, BoundaryValues)
{
private:
using CellCenterBoundaryValues = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
......@@ -182,40 +91,48 @@ public:
};
//! Boundary types at a single degree of freedom
SET_TYPE_PROP(NavierStokes,
SET_TYPE_PROP(FreeFlow,
BoundaryTypes,
StaggeredFreeFlowBoundaryTypes<GET_PROP_VALUE(TypeTag, NumEq)>);
SET_TYPE_PROP(NavierStokes, VelocityOutput, StaggeredFreeFlowVelocityOutput<TypeTag>);
SET_TYPE_PROP(NavierStokes, EnergyLocalResidual, FreeFlowEnergyLocalResidual<TypeTag>);
SET_TYPE_PROP(NavierStokes, EnergyFluxVariables, FreeFlowEnergyFluxVariables<TypeTag>);
SET_BOOL_PROP(NavierStokes, EnableEnergyBalance, false);
//! average is used as default model to compute the effective thermal heat conductivity
// SET_PROP(NavierStokesNI, ThermalConductivityModel)
// { private :
// typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
// public:
// typedef ThermalConductivityAverage<Scalar> type;
// };
//////////////////////////////////////////////////////////////////
// Property values for isothermal model required for the general non-isothermal model
//////////////////////////////////////////////////////////////////
//set isothermal Indices
SET_TYPE_PROP(NavierStokesNI, IsothermalIndices, NavierStokesCommonIndices<TypeTag>);
// //! The flux variables for models involving flow in porous media
// SET_TYPE_PROP(FreeFlow, FluxVariables, PorousMediumFluxVariables<TypeTag>);
//
// //! The flux variables cache class for models involving flow in porous media
// SET_TYPE_PROP(FreeFlow, FluxVariablesCache, PorousMediumFluxVariablesCache<TypeTag>);
//
// //! By default, we use darcy's law for the advective fluxes
// SET_TYPE_PROP(FreeFlow, AdvectionType, DarcysLaw<TypeTag>);
//
// //! By default, we use fick's law for the diffusive fluxes
// SET_TYPE_PROP(FreeFlow, MolecularDiffusionType, FicksLaw<TypeTag>);
//
// //! By default, we use fourier's law as the default for heat conduction fluxes
// SET_TYPE_PROP(FreeFlow, HeatConductionType, FouriersLaw<TypeTag>);
//
// //! By default, parameters are solution-dependent
// SET_BOOL_PROP(FreeFlow, SolutionDependentAdvection, true);
// SET_BOOL_PROP(FreeFlow, SolutionDependentMolecularDiffusion, true);
// SET_BOOL_PROP(FreeFlow, SolutionDependentHeatConduction, true);
//
// //! By default, we evaluate the permeability in the volume
// SET_BOOL_PROP(FreeFlow, EvaluatePermeabilityAtScvfIP, false);
//
// //! The default implementation of the energy balance equation for flow problems in porous media.
// SET_TYPE_PROP(FreeFlow, EnergyLocalResidual, EnergyLocalResidual<TypeTag> );
//set isothermal NumEq
SET_INT_PROP(NavierStokesNI, IsothermalNumEqCellCenter, 1); //!< set the number of equations to 1
SET_INT_PROP(NavierStokesNI, IsothermalNumEqFace, 1); //!< set the number of equations to 1
//! Velocity output
// SET_TYPE_PROP(FreeFlow, VelocityOutput, ImplicitVelocityOutput<TypeTag>);
// \}
} // end namespace Properties
//! By default, we set an empty primary variables switch
// SET_TYPE_PROP(FreeFlow, PrimaryVariableSwitch, NoPrimaryVariableSwitch<TypeTag>);
} // end namespace Dumux
} // namespace Properties
} // namespace Dumux
#endif
#endif
......@@ -23,12 +23,6 @@
#ifndef DUMUX_STAGGERED_NAVIERSTOKES_LOCAL_RESIDUAL_HH
#define DUMUX_STAGGERED_NAVIERSTOKES_LOCAL_RESIDUAL_HH
#include <dune/istl/matrix.hh>
#include <dumux/common/valgrind.hh>
#include <dumux/implicit/staggered/localresidual.hh>
#include "properties.hh"
namespace Dumux
{
......@@ -39,6 +33,8 @@ namespace Properties
NEW_PROP_TAG(EnableComponentTransport);
NEW_PROP_TAG(EnableInertiaTerms);
NEW_PROP_TAG(ReplaceCompEqIdx);
NEW_PROP_TAG(EnergyFluxVariables);
NEW_PROP_TAG(NormalizePressure);
}
/*!
......
......@@ -50,7 +50,4 @@
* The model supports compressible as well as incompressible fluids.
*/
#include "../staggeredni/model.hh"
#include "properties.hh"
#endif
......@@ -27,11 +27,29 @@
#ifndef DUMUX_NAVIERSTOKES_PROPERTIES_HH
#define DUMUX_NAVIERSTOKES_PROPERTIES_HH
#include <dumux/common/basicproperties.hh>
#include <dumux/linear/linearsolverproperties.hh>
#include <dumux/freeflow/properties.hh>
#include <dumux/freeflow/staggeredni/properties.hh>
#include <dumux/freeflow/staggeredni/localresidual.hh>
#include <dumux/freeflow/staggeredni/fluxvariables.hh>
#include <dumux/implicit/staggered/localresidual.hh>
#include "localresidual.hh"
#include "volumevariables.hh"
#include "fluxvariables.hh"
#include "fluxvariablescache.hh"
#include "indices.hh"
#include "velocityoutput.hh"
#include "vtkoutputfields.hh"
#include "boundarytypes.hh"
#include <dumux/material/fluidsystems/gasphase.hh>
#include <dumux/material/fluidsystems/liquidphase.hh>
#include <dumux/material/components/nullcomponent.hh>
#include <dumux/material/fluidsystems/1p.hh>
namespace Dumux
......@@ -47,7 +65,7 @@ namespace Properties {
//////////////////////////////////////////////////////////////////
//! The type tags for the implicit single-phase problems
NEW_TYPE_TAG(NavierStokes, INHERITS_FROM(LinearSolverTypeTag));
NEW_TYPE_TAG(NavierStokes, INHERITS_FROM(FreeFlow, LinearSolverTypeTag));
//! The type tags for the corresponding non-isothermal problems
NEW_TYPE_TAG(NavierStokesNI, INHERITS_FROM(NavierStokes, NavierStokesNonIsothermal));
......@@ -56,23 +74,98 @@ NEW_TYPE_TAG(NavierStokesNI, INHERITS_FROM(NavierStokes, NavierStokesNonIsotherm
// Property tags
//////////////////////////////////////////////////////////////////
NEW_PROP_TAG(NumPhases); //!< Number of fluid phases in the system
NEW_PROP_TAG(Indices); //!< Enumerations for the model
NEW_PROP_TAG(FluidSystem); //!< The type of the fluid system to use
NEW_PROP_TAG(Fluid); //!< The fluid used for the default fluid system
NEW_PROP_TAG(FluidState); //!< The type of the fluid state to use
NEW_PROP_TAG(ProblemEnableGravity); //!< Returns whether gravity is considered in the problem
NEW_PROP_TAG(ImplicitMassUpwindWeight); //!< Returns weight of the upwind cell when calculating fluxes
NEW_PROP_TAG(ImplicitMobilityUpwindWeight); //!< Weight for the upwind mobility in the velocity calculation
NEW_PROP_TAG(VtkAddVelocity); //!< Returns whether velocity vectors are written into the vtk output
NEW_PROP_TAG(EnableInertiaTerms); //!< Returns whether to include inertia terms in the momentum balance eq or not (Stokes / Navier-Stokes)
NEW_PROP_TAG(BoundaryValues); //!< Type to set values on the boundary
NEW_PROP_TAG(EnableComponentTransport); //!< Returns whether to consider component transport or not
NEW_PROP_TAG(EnableEnergyTransport); //!< Returns whether to consider energy transport or not
NEW_PROP_TAG(FaceVariables); //!< Returns whether to consider energy transport or not
NEW_PROP_TAG(NormalizePressure); //!< Returns whether to normalize the pressure term in the momentum balance or not
NEW_PROP_TAG(EnergyLocalResidual); //!< The energy local residual
NEW_PROP_TAG(EnergyFluxVariables); //!< The energy flux variables
///////////////////////////////////////////////////////////////////////////
// default property values for the isothermal single phase model
///////////////////////////////////////////////////////////////////////////
SET_INT_PROP(NavierStokes, NumEqCellCenter, 1); //!< set the number of equations to 1
SET_INT_PROP(NavierStokes, NumPhases, 1); //!< The number of phases in the 1p model is 1
//! The fluid system to use by default
SET_TYPE_PROP(NavierStokes, FluidSystem, Dumux::FluidSystems::OneP<typename GET_PROP_TYPE(TypeTag, Scalar), typename GET_PROP_TYPE(TypeTag, Fluid)>);
SET_PROP(NavierStokes, Fluid)
{ private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
typedef FluidSystems::LiquidPhase<Scalar, Dumux::NullComponent<Scalar> > type;
};
/*!
* \brief The fluid state which is used by the volume variables to
* store the thermodynamic state. This should be chosen
* appropriately for the model ((non-)isothermal, equilibrium, ...).
* This can be done in the problem.
*/
SET_PROP(NavierStokes, FluidState){
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
public:
typedef Dumux::ImmiscibleFluidState<Scalar, FluidSystem> type;
};
//! The local residual function
SET_TYPE_PROP(NavierStokes, LocalResidual, StaggeredNavierStokesResidual<TypeTag>);
//! the VolumeVariables property
SET_TYPE_PROP(NavierStokes, VolumeVariables, NavierStokesVolumeVariables<TypeTag>);
//! The class that contains the different flux variables (i.e. darcy, diffusion, energy)
//! by default, we set the flux variables to ones for porous media
SET_TYPE_PROP(NavierStokes, FluxVariables, FreeFlowFluxVariables<TypeTag>);
//! The flux variables cache class, by default the one for porous media
SET_TYPE_PROP(NavierStokes, FluxVariablesCache, FreeFlowFluxVariablesCache<TypeTag>);
//! Enable advection
SET_BOOL_PROP(NavierStokes, EnableAdvection, true);
//! The one-phase model has no molecular diffusion
SET_BOOL_PROP(NavierStokes, EnableMolecularDiffusion, false);
//! The indices required by the isothermal single-phase model
SET_TYPE_PROP(NavierStokes, Indices, NavierStokesCommonIndices<TypeTag>);
SET_TYPE_PROP(NavierStokes, EnergyLocalResidual, FreeFlowEnergyLocalResidual<TypeTag>);
SET_TYPE_PROP(NavierStokes, EnergyFluxVariables, FreeFlowEnergyFluxVariables<TypeTag>);
SET_BOOL_PROP(NavierStokes, EnableEnergyBalance, false);
SET_TYPE_PROP(NavierStokes, VelocityOutput, StaggeredFreeFlowVelocityOutput<TypeTag>);
// disable velocity output by default
SET_BOOL_PROP(NavierStokes, VtkAddVelocity, true);
SET_TYPE_PROP(NavierStokes, VtkOutputFields, NavierStokesVtkOutputFields<TypeTag>);
SET_BOOL_PROP(NavierStokes, EnableInertiaTerms, true);
SET_BOOL_PROP(NavierStokes, EnableEnergyTransport, false);
SET_BOOL_PROP(NavierStokes, EnableComponentTransport, false);
//! Normalize the pressure term in the momentum balance or not
SET_BOOL_PROP(NavierStokes, NormalizePressure, true);
//////////////////////////////////////////////////////////////////
// Property values for isothermal model required for the general non-isothermal model
//////////////////////////////////////////////////////////////////
//set isothermal Indices
SET_TYPE_PROP(NavierStokesNI, IsothermalIndices, NavierStokesCommonIndices<TypeTag>);
//set isothermal NumEq
SET_INT_PROP(NavierStokesNI, IsothermalNumEqCellCenter, 1); //!< set the number of equations to 1
SET_INT_PROP(NavierStokesNI, IsothermalNumEqFace, 1); //!< set the number of equations to 1
// \}
}
......
......@@ -23,12 +23,9 @@
#ifndef DUMUX_STAGGERED_LOCAL_RESIDUAL_HH
#define DUMUX_STAGGERED_LOCAL_RESIDUAL_HH
#include <dune/istl/matrix.hh>
#include <dumux/common/valgrind.hh>
#include <dumux/common/capabilities.hh>
#include <dumux/common/timeloop.hh>
#include <dumux/discretization/staggered/properties.hh>
namespace Dumux
{
......
......@@ -33,7 +33,7 @@
#include <dumux/material/components/constant.hh>
#include <dumux/discretization/staggered/properties.hh>
#include <dumux/freeflow/staggered/propertydefaults.hh>
#include <dumux/freeflow/staggered/properties.hh>
namespace Dumux
......@@ -71,9 +71,6 @@ SET_BOOL_PROP(DoneaTestProblem, EnableFVGridGeometryCache, true);
SET_BOOL_PROP(DoneaTestProblem, EnableGlobalFluxVariablesCache, true);
SET_BOOL_PROP(DoneaTestProblem, EnableGlobalVolumeVariablesCache, true);
// Enable gravity
SET_BOOL_PROP(DoneaTestProblem, ProblemEnableGravity, true);
#if ENABLE_NAVIERSTOKES
SET_BOOL_PROP(DoneaTestProblem, EnableInertiaTerms, true);
#else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment