Flow123d  3.9.0-4eec2a470
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
TransportDG< Model > Class Template Reference

Transport with dispersion implemented using discontinuous Galerkin method. More...

#include <transport_dg.hh>

Inheritance diagram for TransportDG< Model >:
Inheritance graph
[legend]
Collaboration diagram for TransportDG< Model >:
Collaboration graph
[legend]

Classes

class  EqData
 
class  EqFields
 

Public Types

enum  DGVariant { non_symmetric = -1, incomplete = 0, symmetric = 1 }
 
template<unsigned int dim>
using MassAssemblyDim = MassAssemblyDG< dim, Model >
 
template<unsigned int dim>
using StiffnessAssemblyDim = StiffnessAssemblyDG< dim, Model >
 
template<unsigned int dim>
using SourcesAssemblyDim = SourcesAssemblyDG< dim, Model >
 
template<unsigned int dim>
using BdrConditionAssemblyDim = BdrConditionAssemblyDG< dim, Model >
 
template<unsigned int dim>
using InitConditionAssemblyDim = InitConditionAssemblyDG< dim, Model >
 
template<unsigned int dim>
using InitProjectionAssemblyDim = InitProjectionAssemblyDG< dim, Model >
 
typedef std::vector< std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > > FieldFEScalarVec
 
- Public Types inherited from Model< spacedim, Value >
typedef FieldAlgorithmBase< spacedim, ValueFieldBaseType
 
typedef std::shared_ptr< FieldBaseTypeFieldBasePtr
 

Public Member Functions

 TransportDG (Mesh &init_mesh, const Input::Record in_rec)
 Constructor. More...
 
void zero_time_step () override
 Initialize solution in the zero time. More...
 
bool evaluate_time_constraint (double &)
 
void update_solution () override
 Computes the solution in one time instant. More...
 
void output_data ()
 Postprocesses the solution and writes to output file. More...
 
 ~TransportDG () override
 Destructor. More...
 
void initialize () override
 
void calculate_cumulative_balance ()
 
Vec get_component_vec (unsigned int sbi)
 Return PETSc vector with solution for sbi-th component. More...
 
FieldFEScalarVecget_p0_interpolation ()
 Getter for P0 interpolation by FieldFE. More...
 
void compute_p0_interpolation ()
 Compute P0 interpolation of the solution (used in reaction term). More...
 
void update_after_reactions (bool solution_changed)
 
std::shared_ptr< Balancebalance () const
 Access to balance object of Model. More...
 
Model::ModelEqFields & eq_fields ()
 
Model::ModelEqData & eq_data ()
 

Static Public Member Functions

static const Input::Type::Recordget_input_type ()
 Declare input record type for the equation TransportDG. More...
 
static const Input::Type::Selectionget_dg_variant_selection_input_type ()
 Input type for the DG variant selection. More...
 
- Static Public Member Functions inherited from Model< spacedim, Value >
template<typename Fn , class ... InputFields>
static auto create (Fn fn, InputFields &&... inputs) -> decltype(auto)
 
template<typename Function , typename Tuple , size_t ... I>
static auto call_create (Function f, Tuple t, std::index_sequence< I ... >)
 
template<typename Fn , class ... InputFields>
static auto create_multi (Fn fn, InputFields &&... inputs) -> decltype(auto)
 

Private Member Functions

void preallocate ()
 
void set_initial_condition ()
 Calculates the dispersivity (diffusivity) tensor from the velocity field. More...
 
void output_region_statistics ()
 

Private Attributes

Physical parameters
std::shared_ptr< EqFieldseq_fields_
 Fields for model parameters. More...
 
std::shared_ptr< EqDataeq_data_
 Data for model parameters. More...
 
Solution of algebraic system
std::vector< Vec > rhs
 Vector of right hand side. More...
 
std::vector< Mat > stiffness_matrix
 The stiffness matrix. More...
 
std::vector< Mat > mass_matrix
 The mass matrix. More...
 
std::vector< Vec > mass_vec
 Mass from previous time instant (necessary when coefficients of mass matrix change in time). More...
 
Output to file
Input::Record input_rec
 Array for storing the output solution data. More...
 
ofstream reg_stat_stream
 
Auxiliary fields used during assembly
vector< double > ret_sources
 Temporary values of increments due to retardation (e.g. sorption) More...
 
vector< double > ret_sources_prev
 
Other
bool allocation_done
 Indicates whether matrices have been preallocated. More...
 
bool init_projection
 
GenericAssembly< MassAssemblyDim > * mass_assembly_
 general assembly objects, hold assembly objects of appropriate dimension More...
 
GenericAssembly< StiffnessAssemblyDim > * stiffness_assembly_
 
GenericAssembly< SourcesAssemblyDim > * sources_assembly_
 
GenericAssembly< BdrConditionAssemblyDim > * bdr_cond_assembly_
 
GenericAssemblyBaseinit_assembly_
 

Static Private Attributes

static const int registrar
 Registrar of class to factory. More...
 

Detailed Description

template<class Model>
class TransportDG< Model >

Transport with dispersion implemented using discontinuous Galerkin method.

TransportDG implements the discontinuous Galerkin method for the transport and diffusion of substances. The concentration $ c_i ~[kg/m^3]$ of the i-th substance is governed by the advection-diffusion equation

\[ \partial_t c_i + \mathbf v\cdot\nabla c_i - \mathrm{div}(D\nabla c_i) = F \mbox{ in }\Omega^d, \]

where $\mathbf v$ is the fluid velocity and $\Omega^d$ the $d$-dimensional domain, respectively. The hydrodynamic dispersivity tensor $\mathbf D ~[m^2/s]$ is given by:

\[ \mathbf D = D_m\mathbf I + |\mathbf v|\left(\alpha_T\mathbf I + (\alpha_L-\alpha_T)\frac{\mathbf v\otimes\mathbf v}{|\mathbf v|^2}\right). \]

The molecular dispersivity $D_m~[m^2/s]$, as well as the longitudal and transversal dispersivity $\alpha_L,~\alpha_T~[m]$ are input parameters of the model.

For lower dimensions $d=1,2$ the advection-diffusion equation is multiplied by the fracture cross-cut $\delta^d~[m^{3-d}]$.

The boundary $\partial\Omega^d$ is divided into three disjoint parts $\Gamma^d_D\cup\Gamma^d_N\cup\Gamma^d_F$. We prescribe the following boundary conditions:

\begin{eqnarray*} c_i^d &= c_{iD}^d &\mbox{ on }\Gamma^d_D \mbox{ (Dirichlet)},\\ \mathbf D^d\nabla c_i^d\cdot\mathbf n &= 0 &\mbox{ on }\Gamma^d_N \mbox{ (Neumann)}, \end{eqnarray*}

The transfer of mass through fractures is described by the transmission conditions on $\Gamma^d_F$:

\[ -\mathbf D^d\nabla c_i^d\cdot\mathbf n = \sigma(c_i^d-c_i^{d-1}) + \left\{\begin{array}{cl}0 &\mbox{ if }\mathbf v^d\cdot\mathbf n\ge 0\\\mathbf v^d\cdot\mathbf n(c_i^{d-1}-c_i^d) & \mbox{ if }\mathbf v^d\cdot\mathbf n<0\end{array}\right.,\qquad F^{d-1} = (\sigma + |\mathbf v^d\cdot\mathbf n|)(c_i^d-c_i^{d-1}). \]

Here $\mathbf n$ stands for the unit outward normal vector to $\partial\Omega^d$. The coefficient $\sigma$ determines the transfer of mass through fractures due to diffusion.

Definition at line 134 of file transport_dg.hh.

Member Typedef Documentation

◆ BdrConditionAssemblyDim

template<class Model >
template<unsigned int dim>
using TransportDG< Model >::BdrConditionAssemblyDim = BdrConditionAssemblyDG<dim, Model>

Definition at line 141 of file transport_dg.hh.

◆ FieldFEScalarVec

template<class Model >
typedef std::vector<std::shared_ptr<FieldFE< 3, FieldValue<3>::Scalar> > > TransportDG< Model >::FieldFEScalarVec

Definition at line 145 of file transport_dg.hh.

◆ InitConditionAssemblyDim

template<class Model >
template<unsigned int dim>
using TransportDG< Model >::InitConditionAssemblyDim = InitConditionAssemblyDG<dim, Model>

Definition at line 142 of file transport_dg.hh.

◆ InitProjectionAssemblyDim

template<class Model >
template<unsigned int dim>
using TransportDG< Model >::InitProjectionAssemblyDim = InitProjectionAssemblyDG<dim, Model>

Definition at line 143 of file transport_dg.hh.

◆ MassAssemblyDim

template<class Model >
template<unsigned int dim>
using TransportDG< Model >::MassAssemblyDim = MassAssemblyDG<dim, Model>

Definition at line 138 of file transport_dg.hh.

◆ SourcesAssemblyDim

template<class Model >
template<unsigned int dim>
using TransportDG< Model >::SourcesAssemblyDim = SourcesAssemblyDG<dim, Model>

Definition at line 140 of file transport_dg.hh.

◆ StiffnessAssemblyDim

template<class Model >
template<unsigned int dim>
using TransportDG< Model >::StiffnessAssemblyDim = StiffnessAssemblyDG<dim, Model>

Definition at line 139 of file transport_dg.hh.

Member Enumeration Documentation

◆ DGVariant

template<class Model >
enum TransportDG::DGVariant
Enumerator
non_symmetric 
incomplete 
symmetric 

Definition at line 244 of file transport_dg.hh.

Constructor & Destructor Documentation

◆ TransportDG()

template<typename Model >
TransportDG< Model >::TransportDG ( Mesh init_mesh,
const Input::Record  in_rec 
)

Constructor.

Parameters
init_meshcomputational mesh
in_recinput record

Definition at line 207 of file transport_dg.cc.

◆ ~TransportDG()

template<class Model >
TransportDG< Model >::~TransportDG
override

Destructor.

Definition at line 357 of file transport_dg.cc.

Member Function Documentation

◆ balance()

template<class Model >
std::shared_ptr<Balance> TransportDG< Model >::balance ( ) const
inline

Access to balance object of Model.

Definition at line 313 of file transport_dg.hh.

◆ calculate_cumulative_balance()

template<class Model >
void TransportDG< Model >::calculate_cumulative_balance

Definition at line 650 of file transport_dg.cc.

◆ compute_p0_interpolation()

template<class Model >
void TransportDG< Model >::compute_p0_interpolation

Compute P0 interpolation of the solution (used in reaction term).

Definition at line 598 of file transport_dg.cc.

◆ eq_data()

template<class Model >
Model::ModelEqData& TransportDG< Model >::eq_data ( )
inline

Definition at line 319 of file transport_dg.hh.

◆ eq_fields()

template<class Model >
Model::ModelEqFields& TransportDG< Model >::eq_fields ( )
inline

Definition at line 317 of file transport_dg.hh.

◆ evaluate_time_constraint()

template<class Model >
bool TransportDG< Model >::evaluate_time_constraint ( double &  )
inline

Definition at line 277 of file transport_dg.hh.

◆ get_component_vec()

template<class Model >
Vec TransportDG< Model >::get_component_vec ( unsigned int  sbi)
inline

Return PETSc vector with solution for sbi-th component.

Definition at line 300 of file transport_dg.hh.

◆ get_dg_variant_selection_input_type()

template<class Model >
const Selection & TransportDG< Model >::get_dg_variant_selection_input_type
static

Input type for the DG variant selection.

Definition at line 53 of file transport_dg.cc.

◆ get_input_type()

template<class Model >
const Record & TransportDG< Model >::get_input_type
static

Declare input record type for the equation TransportDG.

Definition at line 79 of file transport_dg.cc.

◆ get_p0_interpolation()

template<class Model >
FieldFEScalarVec& TransportDG< Model >::get_p0_interpolation ( )
inline

Getter for P0 interpolation by FieldFE.

Definition at line 304 of file transport_dg.hh.

◆ initialize()

template<class Model >
void TransportDG< Model >::initialize
override

Definition at line 247 of file transport_dg.cc.

◆ output_data()

template<class Model >
void TransportDG< Model >::output_data

Postprocesses the solution and writes to output file.

Definition at line 625 of file transport_dg.cc.

◆ output_region_statistics()

template<class Model >
void TransportDG< Model >::output_region_statistics ( )
private

◆ preallocate()

template<class Model >
void TransportDG< Model >::preallocate
private

Definition at line 432 of file transport_dg.cc.

◆ set_initial_condition()

template<class Model >
void TransportDG< Model >::set_initial_condition
private

Calculates the dispersivity (diffusivity) tensor from the velocity field.

Parameters
KThe computed dispersivity tensor.
velocityThe velocity field (at quadrature points).
DmMolecular diffusivities.
alphaLLongitudal dispersivities.
alphaTTransversal dispersivities.
porosityPorosities.
cross_cutCross-cuts of higher dimension.

Sets the initial condition.

This method just calls AssemblyDG::prepare_initial_condition() for each elements.

Definition at line 671 of file transport_dg.cc.

◆ update_after_reactions()

template<class Model >
void TransportDG< Model >::update_after_reactions ( bool  solution_changed)

Definition at line 697 of file transport_dg.cc.

◆ update_solution()

template<class Model >
void TransportDG< Model >::update_solution
override

Computes the solution in one time instant.

Definition at line 463 of file transport_dg.cc.

◆ zero_time_step()

template<class Model >
void TransportDG< Model >::zero_time_step
override

Initialize solution in the zero time.

Definition at line 399 of file transport_dg.cc.

Member Data Documentation

◆ allocation_done

template<class Model >
bool TransportDG< Model >::allocation_done
private

Indicates whether matrices have been preallocated.

Definition at line 415 of file transport_dg.hh.

◆ bdr_cond_assembly_

template<class Model >
GenericAssembly< BdrConditionAssemblyDim >* TransportDG< Model >::bdr_cond_assembly_
private

Definition at line 424 of file transport_dg.hh.

◆ eq_data_

template<class Model >
std::shared_ptr<EqData> TransportDG< Model >::eq_data_
private

Data for model parameters.

Definition at line 362 of file transport_dg.hh.

◆ eq_fields_

template<class Model >
std::shared_ptr<EqFields> TransportDG< Model >::eq_fields_
private

Fields for model parameters.

Definition at line 359 of file transport_dg.hh.

◆ init_assembly_

template<class Model >
GenericAssemblyBase* TransportDG< Model >::init_assembly_
private

Definition at line 425 of file transport_dg.hh.

◆ init_projection

template<class Model >
bool TransportDG< Model >::init_projection
private

Definition at line 417 of file transport_dg.hh.

◆ input_rec

template<class Model >
Input::Record TransportDG< Model >::input_rec
private

Array for storing the output solution data.

Record with input specification.

Definition at line 392 of file transport_dg.hh.

◆ mass_assembly_

template<class Model >
GenericAssembly< MassAssemblyDim >* TransportDG< Model >::mass_assembly_
private

general assembly objects, hold assembly objects of appropriate dimension

Definition at line 421 of file transport_dg.hh.

◆ mass_matrix

template<class Model >
std::vector<Mat> TransportDG< Model >::mass_matrix
private

The mass matrix.

Definition at line 378 of file transport_dg.hh.

◆ mass_vec

template<class Model >
std::vector<Vec> TransportDG< Model >::mass_vec
private

Mass from previous time instant (necessary when coefficients of mass matrix change in time).

Definition at line 381 of file transport_dg.hh.

◆ reg_stat_stream

template<class Model >
ofstream TransportDG< Model >::reg_stat_stream
private

Definition at line 394 of file transport_dg.hh.

◆ registrar

template<class Model >
const int TransportDG< Model >::registrar
staticprivate
Initial value:
=
Input::register_class< TransportDG<Model>, Mesh &, const Input::Record>(std::string(Model::ModelEqData::name()) + "_DG") +

Registrar of class to factory.

Definition at line 323 of file transport_dg.hh.

◆ ret_sources

template<class Model >
vector<double> TransportDG< Model >::ret_sources
private

Temporary values of increments due to retardation (e.g. sorption)

Definition at line 404 of file transport_dg.hh.

◆ ret_sources_prev

template<class Model >
vector<double> TransportDG< Model >::ret_sources_prev
private

Definition at line 404 of file transport_dg.hh.

◆ rhs

template<class Model >
std::vector<Vec> TransportDG< Model >::rhs
private

Vector of right hand side.

Definition at line 372 of file transport_dg.hh.

◆ sources_assembly_

template<class Model >
GenericAssembly< SourcesAssemblyDim >* TransportDG< Model >::sources_assembly_
private

Definition at line 423 of file transport_dg.hh.

◆ stiffness_assembly_

template<class Model >
GenericAssembly< StiffnessAssemblyDim >* TransportDG< Model >::stiffness_assembly_
private

Definition at line 422 of file transport_dg.hh.

◆ stiffness_matrix

template<class Model >
std::vector<Mat> TransportDG< Model >::stiffness_matrix
private

The stiffness matrix.

Definition at line 375 of file transport_dg.hh.


The documentation for this class was generated from the following files:
Input::Record
Accessor to the data with type Type::Record.
Definition: accessors.hh:291
TransportDG
Transport with dispersion implemented using discontinuous Galerkin method.
Definition: transport_dg.hh:134
Mesh
Definition: mesh.h:361