Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
065af9fd
Commit
065af9fd
authored
Apr 24, 2018
by
Thomas Fetzer
Committed by
Kilian Weishaupt
Apr 27, 2018
Browse files
[lowrekepsilon2c] First version of a compositional two-eq RANS model
parent
a27d543a
Changes
31
Hide whitespace changes
Inline
Side-by-side
doc/doxygen/modules.txt
View file @
065af9fd
...
...
@@ -206,35 +206,14 @@
* \ingroup FreeflowModels
* \defgroup FreeflowNCModel Compositional
* \brief Single-phase multi-component free-flow flow models
* \copydetails ./freeflow/compositional/navierstokesncmodel.hh
*/
/*!
* \ingroup FreeflowNCModel
* \defgroup NavierStokesNCModel Compositional Navier-Stokes
* \brief Single-phase multi-component Navier-Stokes flow
* \copydetails ./freeflow/compositional/navierstokesncmodel.hh
*/
/*!
* \ingroup FreeflowNCModel
* \defgroup RANSNCModel Compositional Reynolds-Averaged Navier-Stokes
* \brief Single-phase multi-component Reynolds-Averaged Navier-Stokes flow
* \copydetails ./freeflow/ransnc/model.hh
*/
/*!
* \ingroup FreeflowModels
* \defgroup FreeflowNIModel Nonisothermal
* \brief An energy equation adaptor for isothermal free-flow models
* \copydetails ./freeflow/nonisothermal/model.hh
*/
/*!
* \ingroup FreeflowNIModel
* \defgroup NavierStokesNIModel Nonisothermal Navier-Stokes
* \brief An energy equation adaptor for isothermal Navier-Stokes models
*/
/*!
* \ingroup FreeflowNIModel
* \defgroup RANSNIModel Nonisothermal Reynolds-Averaged Navier-Stokes
* \brief An energy equation adaptor for isothermal Reynolds-Averaged Navier-Stokes models
*/
/* ***************** Benchmarks and Tests ******************/
/*!
...
...
dumux/freeflow/compositional/CMakeLists.txt
View file @
065af9fd
...
...
@@ -6,6 +6,8 @@ fluxvariables.hh
indices.hh
localresidual.hh
navierstokesncmodel.hh
lowrekepsilonncmodel.hh
volumevariables.hh
vtkoutputfields.hh
zeroeqncmodel.hh
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dumux/freeflow/compositional
)
dumux/freeflow/compositional/fluxvariables.hh
View file @
065af9fd
...
...
@@ -32,7 +32,7 @@ namespace Dumux
// forward declaration
template
<
class
TypeTag
,
DiscretizationMethod
discMethod
>
template
<
class
TypeTag
,
class
BaseFluxVariables
,
DiscretizationMethod
discMethod
>
class
FreeflowNCFluxVariablesImpl
;
/*!
...
...
@@ -42,8 +42,8 @@ class FreeflowNCFluxVariablesImpl;
discretization-specific flux variables.
* \note Not all specializations are currently implemented
*/
template
<
class
TypeTag
>
using
FreeflowNCFluxVariables
=
FreeflowNCFluxVariablesImpl
<
TypeTag
,
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
discMethod
>
;
template
<
class
TypeTag
,
class
BaseFluxVariables
>
using
FreeflowNCFluxVariables
=
FreeflowNCFluxVariablesImpl
<
TypeTag
,
BaseFluxVariables
,
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
discMethod
>
;
}
// end namespace
...
...
dumux/freeflow/compositional/indices.hh
View file @
065af9fd
...
...
@@ -33,8 +33,9 @@ namespace Dumux {
* \brief The common indices for the isothermal multi-component free-flow model.
*/
template
<
int
dimension
,
int
numEquations
,
int
phaseIdx
,
int
theReplaceCompEqIdx
>
struct
FreeflowNCIndices
:
public
NavierStokesIndices
<
dimension
>
int
phaseIdx
,
int
theReplaceCompEqIdx
,
class
FreeflowIndices
>
struct
FreeflowNCIndices
:
public
FreeflowIndices
{
public:
//! The index of the fluid phase in the fluid system
...
...
dumux/freeflow/compositional/localresidual.hh
View file @
065af9fd
...
...
@@ -33,7 +33,7 @@ namespace Dumux
{
// forward declaration
template
<
class
TypeTag
,
DiscretizationMethod
discMethod
>
template
<
class
TypeTag
,
class
BaseLocalResidual
,
DiscretizationMethod
discMethod
>
class
FreeflowNCResidualImpl
;
/*!
...
...
@@ -43,8 +43,8 @@ class FreeflowNCResidualImpl;
discretization-specific local residual.
* \note Not all specializations are currently implemented
*/
template
<
class
TypeTag
>
using
FreeflowNCResidual
=
FreeflowNCResidualImpl
<
TypeTag
,
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
discMethod
>
;
template
<
class
TypeTag
,
class
BaseLocalResidual
>
using
FreeflowNCResidual
=
FreeflowNCResidualImpl
<
TypeTag
,
BaseLocalResidual
,
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
discMethod
>
;
}
...
...
dumux/freeflow/compositional/lowrekepsilonncmodel.hh
0 → 100644
View file @
065af9fd
// -*- 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 2 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 FreeflowNCModel
*
* \brief A single-phase, multi-component Reynolds-Averaged Navier-Stokes 0-Eq. model
*
* \copydoc Dumux::FreeflowNCModel
*/
#ifndef DUMUX_LOWREKEPSILON_NC_MODEL_HH
#define DUMUX_LOWREKEPSILON_NC_MODEL_HH
#include <dumux/common/properties.hh>
#include <dumux/freeflow/compositional/navierstokesncmodel.hh>
#include <dumux/freeflow/nonisothermal/vtkoutputfields.hh>
#include <dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh>
#include "vtkoutputfields.hh"
#include <dumux/freeflow/ransnc/volumevariables.hh>
namespace
Dumux
{
///////////////////////////////////////////////////////////////////////////
// properties for the single-phase, multi-component low-Re k-epsilon model
///////////////////////////////////////////////////////////////////////////
namespace
Properties
{
//////////////////////////////////////////////////////////////////
// Type tags
//////////////////////////////////////////////////////////////////
//! The type tags for the single-phase, multi-component isothermal low-Re k-epsilon model
NEW_TYPE_TAG
(
LowReKEpsilonNC
,
INHERITS_FROM
(
NavierStokesNC
));
///////////////////////////////////////////////////////////////////////////
// default property values
///////////////////////////////////////////////////////////////////////////
/*!
* \ingroup FreeflowNCModel
* \brief Traits for the low-Reynolds k-epsilon multi-component model
*/
template
<
int
dimension
,
int
nComp
,
int
phaseIdx
,
int
replaceCompEqIdx
,
bool
useMoles
>
struct
LowReKEpsilonNCModelTraits
:
NavierStokesNCModelTraits
<
dimension
,
nComp
,
phaseIdx
,
replaceCompEqIdx
,
useMoles
>
{
//! There are as many momentum balance equations as dimensions
//! and as many balance equations as components.
static
constexpr
int
numEq
()
{
return
dimension
+
nComp
+
2
;
}
//! The model does include a turbulence model
static
constexpr
bool
usesTurbulenceModel
()
{
return
true
;
}
//! the indices
using
Indices
=
FreeflowNCIndices
<
dimension
,
numEq
(),
phaseIdx
,
replaceCompEqIdx
,
LowReKEpsilonIndices
<
dimension
,
nComp
>>
;
};
//!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model
SET_PROP
(
LowReKEpsilonNC
,
ModelTraits
)
{
private:
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
GridView
;
static
constexpr
int
dimension
=
GridView
::
dimension
;
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
static
constexpr
int
numComponents
=
FluidSystem
::
numComponents
;
static
constexpr
int
phaseIdx
=
GET_PROP_VALUE
(
TypeTag
,
PhaseIdx
);
static
constexpr
int
replaceCompEqIdx
=
GET_PROP_VALUE
(
TypeTag
,
ReplaceCompEqIdx
);
static
constexpr
bool
useMoles
=
GET_PROP_VALUE
(
TypeTag
,
UseMoles
);
public:
using
type
=
LowReKEpsilonNCModelTraits
<
dimension
,
numComponents
,
phaseIdx
,
replaceCompEqIdx
,
useMoles
>
;
};
//! Set the volume variables property
SET_PROP
(
LowReKEpsilonNC
,
VolumeVariables
)
{
private:
using
PV
=
typename
GET_PROP_TYPE
(
TypeTag
,
PrimaryVariables
);
using
FSY
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
using
FST
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidState
);
using
MT
=
typename
GET_PROP_TYPE
(
TypeTag
,
ModelTraits
);
using
Traits
=
NavierStokesVolumeVariablesTraits
<
PV
,
FSY
,
FST
,
MT
>
;
using
NCVolVars
=
FreeflowNCVolumeVariables
<
Traits
>
;
using
RANSVolVars
=
LowReKEpsilonVolumeVariables
<
Traits
,
NCVolVars
>
;
public:
using
type
=
RANSNCVolumeVariables
<
Traits
,
RANSVolVars
>
;
};
//! The local residual
SET_PROP
(
LowReKEpsilonNC
,
LocalResidual
)
{
private:
using
BaseLocalResidual
=
LowReKEpsilonResidual
<
TypeTag
>
;
public:
using
type
=
FreeflowNCResidual
<
TypeTag
,
BaseLocalResidual
>
;
};
//! The flux variables
SET_PROP
(
LowReKEpsilonNC
,
FluxVariables
)
{
private:
using
BaseFluxVariables
=
LowReKEpsilonFluxVariables
<
TypeTag
>
;
public:
using
type
=
FreeflowNCFluxVariables
<
TypeTag
,
BaseFluxVariables
>
;
};
//! The specific vtk output fields
SET_PROP
(
LowReKEpsilonNC
,
VtkOutputFields
)
{
private:
using
ModelTraits
=
typename
GET_PROP_TYPE
(
TypeTag
,
ModelTraits
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
static
constexpr
int
phaseIdx
=
GET_PROP_VALUE
(
TypeTag
,
PhaseIdx
);
using
SinglePhaseVtkOutputFields
=
LowReKEpsilonVtkOutputFields
<
FVGridGeometry
>
;
public:
using
type
=
FreeflowNCVtkOutputFields
<
SinglePhaseVtkOutputFields
,
ModelTraits
,
FVGridGeometry
,
FluidSystem
,
phaseIdx
>
;
};
//////////////////////////////////////////////////////////////////////////
// Property values for non-isothermal multi-component low-Re k-epsilon model
//////////////////////////////////////////////////////////////////////////
//! The type tags for the single-phase, multi-component non-isothermal low-Re k-epsilon models
NEW_TYPE_TAG
(
LowReKEpsilonNCNI
,
INHERITS_FROM
(
NavierStokesNCNI
));
//! The model traits of the non-isothermal model
SET_PROP
(
LowReKEpsilonNCNI
,
ModelTraits
)
{
private:
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
GridView
;
static
constexpr
int
dim
=
GridView
::
dimension
;
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
static
constexpr
int
numComponents
=
FluidSystem
::
numComponents
;
static
constexpr
int
phaseIdx
=
GET_PROP_VALUE
(
TypeTag
,
PhaseIdx
);
static
constexpr
int
replaceCompEqIdx
=
GET_PROP_VALUE
(
TypeTag
,
ReplaceCompEqIdx
);
static
constexpr
bool
useMoles
=
GET_PROP_VALUE
(
TypeTag
,
UseMoles
);
using
IsothermalModelTraits
=
LowReKEpsilonNCModelTraits
<
dim
,
numComponents
,
phaseIdx
,
replaceCompEqIdx
,
useMoles
>
;
public:
using
type
=
FreeflowNIModelTraits
<
IsothermalModelTraits
>
;
};
//! Set the volume variables property
SET_PROP
(
LowReKEpsilonNCNI
,
VolumeVariables
)
{
private:
using
PV
=
typename
GET_PROP_TYPE
(
TypeTag
,
PrimaryVariables
);
using
FSY
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
using
FST
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidState
);
using
MT
=
typename
GET_PROP_TYPE
(
TypeTag
,
ModelTraits
);
using
Traits
=
NavierStokesVolumeVariablesTraits
<
PV
,
FSY
,
FST
,
MT
>
;
using
NCVolVars
=
FreeflowNCVolumeVariables
<
Traits
>
;
using
RANSVolVars
=
LowReKEpsilonVolumeVariables
<
Traits
,
NCVolVars
>
;
public:
using
type
=
RANSNCVolumeVariables
<
Traits
,
RANSVolVars
>
;
};
//! The local residual
SET_PROP
(
LowReKEpsilonNCNI
,
LocalResidual
)
{
private:
using
BaseLocalResidual
=
LowReKEpsilonResidual
<
TypeTag
>
;
public:
using
type
=
FreeflowNCResidual
<
TypeTag
,
BaseLocalResidual
>
;
};
//! The flux variables
SET_PROP
(
LowReKEpsilonNCNI
,
FluxVariables
)
{
private:
using
BaseFluxVariables
=
LowReKEpsilonFluxVariables
<
TypeTag
>
;
public:
using
type
=
FreeflowNCFluxVariables
<
TypeTag
,
BaseFluxVariables
>
;
};
//! The specific vtk output fields
SET_PROP
(
LowReKEpsilonNCNI
,
VtkOutputFields
)
{
private:
using
ModelTraits
=
typename
GET_PROP_TYPE
(
TypeTag
,
ModelTraits
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
static
constexpr
int
phaseIdx
=
GET_PROP_VALUE
(
TypeTag
,
PhaseIdx
);
using
BaseVtkOutputFields
=
LowReKEpsilonVtkOutputFields
<
FVGridGeometry
>
;
using
NonIsothermalFields
=
FreeflowNonIsothermalVtkOutputFields
<
BaseVtkOutputFields
,
ModelTraits
>
;
public:
using
type
=
FreeflowNCVtkOutputFields
<
NonIsothermalFields
,
ModelTraits
,
FVGridGeometry
,
FluidSystem
,
phaseIdx
>
;
};
// \}
}
// end namespace Properties
}
// end namespace Dumux
#endif
dumux/freeflow/compositional/navierstokesncmodel.hh
View file @
065af9fd
...
...
@@ -26,21 +26,24 @@
* \f[
* \frac{\partial \left(\varrho X^\kappa\right)}{\partial t}
* + \nabla \cdot \left( \varrho {\boldsymbol{v}} X^\kappa
* - D^\kappa \varrho \frac{M^\kappa}{M} \textbf{grad}\, x^\kappa \right)
* -
(
D^\kappa
+ D_\text{t})
\varrho \frac{M^\kappa}{M} \textbf{grad}\, x^\kappa \right)
* - q^\kappa = 0
* \f]
*
* Alternatively, one component balance equation can be replace by a <B> total mass/mole balance equation </B>:
*
* \f[
* \frac{\partial \varrho_g}{\partial t}
* + \nabla \cdot \left(
* \varrho {\boldsymbol{v}}
* - \sum_\kappa D^\kappa \varrho \frac{M^\kappa}{M} \textbf{grad}\, x^\kappa
* - \sum_\kappa
(
D^\kappa
+ D_\text{t})
\varrho \frac{M^\kappa}{M} \textbf{grad}\, x^\kappa
* \right)
* - q = 0
* \f]
*
* The eddy diffusivity \f$ D_\text{t} \f$ is related to the eddy viscosity \f$ \nu_\text{t} \f$
* by the turbulent Schmidt number, for Navier-Stokes models \f$ D_\text{t} = 0 \f$.
* \f[ D_\text{t} = \frac{\nu_\text{t}}{\mathrm{Sc}_\text{t}} \f]
*
* So far, only the staggered grid spatial discretization (for structured grids) is available.
*/
...
...
@@ -52,7 +55,7 @@
#include <dumux/freeflow/navierstokes/model.hh>
#include <dumux/freeflow/nonisothermal/model.hh>
#include <dumux/freeflow/nonisothermal/indices.hh>
#include <dumux/freeflow/nonisothermal/
navierstokesni
vtkoutputfields.hh>
#include <dumux/freeflow/nonisothermal/vtkoutputfields.hh>
#include <dumux/discretization/fickslaw.hh>
#include <dumux/discretization/fourierslaw.hh>
...
...
@@ -75,35 +78,23 @@ namespace Dumux {
* \brief Traits for the multi-component free-flow model
*/
template
<
int
dimension
,
int
nComp
,
int
phaseIdx
,
int
replaceCompEqIdx
,
bool
useM
>
struct
NavierStokesNCModelTraits
struct
NavierStokesNCModelTraits
:
NavierStokesModelTraits
<
dimension
>
{
//! The dimension of the model
static
constexpr
int
dim
()
{
return
dimension
;
}
//! There are as many momentum balance equations as dimensions
//! and as many balance equations as components.
static
constexpr
int
numEq
()
{
return
dimension
+
nComp
;
}
//! The number of phases is always 1
static
constexpr
int
numPhases
()
{
return
1
;
}
//! The number of components
static
constexpr
int
numComponents
()
{
return
nComp
;
}
//! Use moles or not
static
constexpr
bool
useMoles
()
{
return
useM
;
}
//! Enable advection
static
constexpr
bool
enableAdvection
()
{
return
true
;
}
//! The one-phase model has no molecular diffusion
static
constexpr
bool
enableMolecularDiffusion
()
{
return
true
;
}
//! The model is isothermal
static
constexpr
bool
enableEnergyBalance
()
{
return
false
;
}
//! the indices
using
Indices
=
FreeflowNCIndices
<
dim
()
,
numEq
(),
phaseIdx
,
replaceCompEqIdx
>
;
using
Indices
=
FreeflowNCIndices
<
dim
ension
,
numEq
(),
phaseIdx
,
replaceCompEqIdx
,
NavierStokesIndices
<
dimension
>
>
;
};
///////////////////////////////////////////////////////////////////////////
...
...
@@ -146,9 +137,14 @@ SET_INT_PROP(NavierStokesNC, ReplaceCompEqIdx, 0); //<! Set the ReplaceCompEqIdx
SET_BOOL_PROP
(
NavierStokesNC
,
EnableInertiaTerms
,
true
);
//!< Consider inertia terms by default
SET_BOOL_PROP
(
NavierStokesNC
,
NormalizePressure
,
true
);
//!< Normalize the pressure term in the momentum balance by default
//! The local residual
SET_TYPE_PROP
(
NavierStokesNC
,
LocalResidual
,
FreeflowNCResidual
<
TypeTag
>
);
SET_PROP
(
NavierStokesNC
,
LocalResidual
)
{
private:
using
BaseLocalResidual
=
NavierStokesResidual
<
TypeTag
>
;
public:
using
type
=
FreeflowNCResidual
<
TypeTag
,
BaseLocalResidual
>
;
};
//! Set the volume variables property
SET_PROP
(
NavierStokesNC
,
VolumeVariables
)
...
...
@@ -164,9 +160,14 @@ public:
using
type
=
FreeflowNCVolumeVariables
<
Traits
>
;
};
//! The flux variables
SET_TYPE_PROP
(
NavierStokesNC
,
FluxVariables
,
FreeflowNCFluxVariables
<
TypeTag
>
);
SET_PROP
(
NavierStokesNC
,
FluxVariables
)
{
private:
using
BaseFluxVariables
=
NavierStokesFluxVariables
<
TypeTag
>
;
public:
using
type
=
FreeflowNCFluxVariables
<
TypeTag
,
BaseFluxVariables
>
;
};
//! The flux variables cache class, by default the one for free flow
SET_TYPE_PROP
(
NavierStokesNC
,
FluxVariablesCache
,
FreeFlowFluxVariablesCache
<
TypeTag
>
);
...
...
@@ -175,11 +176,13 @@ SET_TYPE_PROP(NavierStokesNC, FluxVariablesCache, FreeFlowFluxVariablesCache<Typ
SET_PROP
(
NavierStokesNC
,
VtkOutputFields
)
{
private:
using
ModelTraits
=
typename
GET_PROP_TYPE
(
TypeTag
,
ModelTraits
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
static
constexpr
int
phaseIdx
=
GET_PROP_VALUE
(
TypeTag
,
PhaseIdx
);
using
BaseVtkOutputFields
=
NavierStokesVtkOutputFields
<
FVGridGeometry
>
;
public:
using
type
=
FreeflowNCVtkOutputFields
<
FVGridGeometry
,
FluidSystem
,
phaseIdx
>
;
using
type
=
FreeflowNCVtkOutputFields
<
BaseVtkOutputFields
,
ModelTraits
,
FVGridGeometry
,
FluidSystem
,
phaseIdx
>
;
};
/*!
...
...
@@ -224,12 +227,14 @@ public:
SET_PROP
(
NavierStokesNCNI
,
VtkOutputFields
)
{
private:
using
ModelTraits
=
typename
GET_PROP_TYPE
(
TypeTag
,
ModelTraits
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
static
constexpr
int
phaseIdx
=
GET_PROP_VALUE
(
TypeTag
,
PhaseIdx
);
using
IsothermalFields
=
FreeflowNCVtkOutputFields
<
FVGridGeometry
,
FluidSystem
,
phaseIdx
>
;
using
BaseVtkOutputFields
=
NavierStokesVtkOutputFields
<
FVGridGeometry
>
;
using
NonIsothermalFields
=
FreeflowNonIsothermalVtkOutputFields
<
BaseVtkOutputFields
,
ModelTraits
>
;
public:
using
type
=
NavierStokesNonIsothermal
VtkOutputFields
<
IsothermalFields
>
;
using
type
=
FreeflowNC
VtkOutputFields
<
Non
IsothermalFields
,
ModelTraits
,
FVGridGeometry
,
FluidSystem
,
phaseIdx
>
;
};
//! Use Fourier's Law as default heat conduction type
...
...
dumux/freeflow/compositional/staggered/fluxvariables.hh
View file @
065af9fd
...
...
@@ -34,18 +34,18 @@ namespace Dumux
{
// forward declaration
template
<
class
TypeTag
,
DiscretizationMethod
discMethod
>
template
<
class
TypeTag
,
class
BaseFluxVariables
,
DiscretizationMethod
discMethod
>
class
FreeflowNCFluxVariablesImpl
;
/*!
* \ingroup FreeflowNCModel
* \brief The flux variables class for the multi-component free-flow model using the staggered grid discretization.
*/
template
<
class
TypeTag
>
class
FreeflowNCFluxVariablesImpl
<
TypeTag
,
DiscretizationMethod
::
staggered
>
:
public
NavierStokes
FluxVariables
<
TypeTag
>
template
<
class
TypeTag
,
class
BaseFluxVariables
>
class
FreeflowNCFluxVariablesImpl
<
TypeTag
,
BaseFluxVariables
,
DiscretizationMethod
::
staggered
>
:
public
Base
FluxVariables
{
using
ParentType
=
NavierStokes
FluxVariables
<
TypeTag
>
;
using
ParentType
=
Base
FluxVariables
;
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
...
...
@@ -75,7 +75,7 @@ public:
const
SubControlVolumeFace
&
scvf
,
const
FluxVariablesCache
&
fluxVarsCache
)
{
CellCenterPrimaryVariables
flux
(
0.0
);
CellCenterPrimaryVariables
flux
=
ParentType
::
computeFluxForCellCenter
(
problem
,
element
,
fvGeometry
,
elemVolVars
,
elemFaceVars
,
scvf
,
fluxVarsCache
);
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
++
compIdx
)
{
...
...
dumux/freeflow/compositional/staggered/localresidual.hh
View file @
065af9fd
...
...
@@ -31,20 +31,18 @@
namespace
Dumux
{
// forward declaration
template
<
class
TypeTag
,
DiscretizationMethod
discMethod
>
template
<
class
TypeTag
,
class
BaseLocalResidual
,
DiscretizationMethod
discMethod
>
class
FreeflowNCResidualImpl
;
/*!
* \ingroup FreeflowNCModel
* \brief Element-wise calculation of the multi-component free-flow residual for models using the staggered discretization
*/
template
<
class
TypeTag
>
class
FreeflowNCResidualImpl
<
TypeTag
,
DiscretizationMethod
::
staggered
>
:
public
NavierStokesResidual
<
TypeTag
>
template
<
class
TypeTag
,
class
BaseLocalResidual
>
class
FreeflowNCResidualImpl
<
TypeTag
,
BaseLocalResidual
,
DiscretizationMethod
::
staggered
>
:
public
BaseLocalResidual
{
using
ParentType
=
NavierStokesResidual
<
TypeTag
>
;
friend
class
StaggeredLocalResidual
<
TypeTag
>
;
friend
ParentType
;
using
ParentType
=
BaseLocalResidual
;
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
...
...
@@ -70,7 +68,7 @@ public:
const
SubControlVolume
&
scv
,
const
VolumeVariables
&
volVars
)
const
{
CellCenterPrimaryVariables
storage
(
0.0
);
CellCenterPrimaryVariables
storage
=
ParentType
::
computeStorageForCellCenter
(
problem
,
scv
,
volVars
);
const
Scalar
density
=
useMoles
?
volVars
.
molarDensity
()
:
volVars
.
density
();
...
...
@@ -96,20 +94,19 @@ public:
return
storage
;
}
protected:
/*!
* \brief Sets a fixed Dirichlet value for a cell (such as pressure) at the boundary.
* This is a provisional alternative to setting the Dirichlet value on the boundary directly.
*/
template
<
class
ElementVolumeVariables
,
class
BoundaryTypes
>
void
setFixedCell
_
(
CellCenterResidual
&
residual
,
const
Problem
&
problem
,
const
SubControlVolume
&
insideScv
,
const
ElementVolumeVariables
&
elemVolVars
,
const
BoundaryTypes
&
bcTypes
)
const
void
setFixedCell
(
CellCenterResidual
&
residual
,
const
Problem
&
problem
,
const
SubControlVolume
&
insideScv
,
const
ElementVolumeVariables
&
elemVolVars
,
const
BoundaryTypes
&
bcTypes
)
const
{
ParentType
::
setFixedCell
_
(
residual
,
problem
,
insideScv
,
elemVolVars
,
bcTypes
);
ParentType
::
setFixedCell
(
residual
,
problem
,
insideScv
,
elemVolVars
,
bcTypes
);
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
++
compIdx
)
{
...
...
dumux/freeflow/compositional/volumevariables.hh
View file @
065af9fd
...
...
@@ -188,25 +188,25 @@ public:
Scalar
viscosity
()
const
{
return
fluidState_
.
viscosity
(
fluidSystemPhaseIdx
);
}
/*!
* \brief Returns the mass fraction of a component in the phase \f$\mathrm{[-]}\f$
*
* \param compIdx the index of the component
*/
Scalar
massFraction
(
int
compIdx
)
const
{
return
fluidState_
.
massFraction
(
fluidSystemPhaseIdx
,
compIdx
);
}
/*!
* \brief Returns the mass fraction of a component in the phase \f$\mathrm{[-]}\f$
*
* \param compIdx the index of the component
*/
Scalar
massFraction
(
int
compIdx
)
const
{
return
fluidState_
.
massFraction
(
fluidSystemPhaseIdx
,
compIdx
);
}
/*!
* \brief Returns the mole fraction of a component in the phase \f$\mathrm{[-]}\f$
*
* \param compIdx the index of the component
*/
Scalar
moleFraction
(
int
compIdx
)
const
{
return
fluidState_
.
moleFraction
(
fluidSystemPhaseIdx
,
compIdx
);
}
/*!
* \brief Returns the mole fraction of a component in the phase \f$\mathrm{[-]}\f$
*
* \param compIdx the index of the component
*/
Scalar
moleFraction
(
int
compIdx
)
const
{
return
fluidState_
.
moleFraction
(
fluidSystemPhaseIdx
,
compIdx
);
}
/*!
* \brief Returns the mass density of a given phase \f$\mathrm{[kg/m^3]}\f$
...
...
dumux/freeflow/compositional/vtkoutputfields.hh