Flow123d  release_3.0.0-863-g23f23ed
Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ConcentrationTransportModel Class Referenceabstract

#include <concentration_model.hh>

Inheritance diagram for ConcentrationTransportModel:
Inheritance graph
[legend]
Collaboration diagram for ConcentrationTransportModel:
Collaboration graph
[legend]

Classes

class  ModelEqData
 

Public Types

typedef ConcentrationTransportBase FactoryBaseType
 
- Public Types inherited from AdvectionDiffusionModel
enum  Abstract_bc_types { abc_inflow, abc_dirichlet, abc_total_flux, abc_diffusive_flux }
 

Public Member Functions

 ConcentrationTransportModel (Mesh &mesh, const Input::Record &in_rec)
 
void init_from_input (const Input::Record &in_rec) override
 Read necessary data from input record. More...
 
void compute_mass_matrix_coefficient (const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< double > &mm_coef) override
 
void compute_retardation_coefficient (const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< double > > &ret_coef) override
 
void compute_advection_diffusion_coefficients (const std::vector< arma::vec3 > &point_list, const std::vector< arma::vec3 > &velocity, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< arma::vec3 > > &ad_coef, std::vector< std::vector< arma::mat33 > > &dif_coef) override
 
void compute_init_cond (const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< double > > &init_values) override
 
void get_bc_type (const ElementAccessor< 3 > &ele_acc, arma::uvec &bc_types) override
 
void get_flux_bc_data (unsigned int index, const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< double > &bc_flux, std::vector< double > &bc_sigma, std::vector< double > &bc_ref_value) override
 Return data for diffusive or total flux b.c. More...
 
void get_flux_bc_sigma (unsigned int index, const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< double > &bc_sigma) override
 Return transition coefficient for flux b.c. More...
 
void compute_source_coefficients (const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< double > > &sources_conc, std::vector< std::vector< double > > &sources_density, std::vector< std::vector< double > > &sources_sigma) override
 
void compute_sources_sigma (const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< double > > &sources_sigma) override
 
 ~ConcentrationTransportModel () override
 
void set_velocity_field (const MH_DofHandler &dh) override
 Updates the velocity field which determines some coefficients of the transport equation. More...
 
unsigned int n_substances () override
 Returns number of transported substances. More...
 
SubstanceListsubstances () override
 Returns reference to the vector of substance names. More...
 
void set_target_time (double target_time) override
 
void set_balance_object (std::shared_ptr< Balance > balance) override
 
const vector< unsigned int > & get_subst_idx () override
 Return substance indices used in balance. More...
 
void set_output_stream (std::shared_ptr< OutputTime > stream)
 Setter for output stream. More...
 
std::shared_ptr< OutputTimeoutput_stream () override
 Getter for output stream. More...
 
- Public Member Functions inherited from AdvectionDiffusionModel
virtual ~AdvectionDiffusionModel ()
 Destructor. More...
 
- Public Member Functions inherited from ConcentrationTransportBase
 ConcentrationTransportBase (Mesh &init_mesh, const Input::Record in_rec)
 
virtual bool evaluate_time_constraint (double &time_constraint)=0
 Computes a constraint for time step. More...
 
virtual void calculate_concentration_matrix ()=0
 Calculate the array of concentrations per element (for reactions). More...
 
virtual void update_after_reactions (bool solution_changed)=0
 Perform changes to transport solution after reaction step. More...
 
virtual double ** get_concentration_matrix ()=0
 Getter for array of concentrations per element. More...
 
virtual const Vec & get_solution (unsigned int sbi)=0
 Return PETSc vector with solution for sbi-th substance. More...
 
virtual void get_par_info (LongIdx *&el_4_loc, Distribution *&el_ds)=0
 Return array of indices of local elements and parallel distribution of elements. More...
 
virtual LongIdxget_row_4_el ()=0
 Return global array of order of elements within parallel vector. More...
 
- Public Member Functions inherited from EquationBase
 EquationBase ()
 
 EquationBase (Mesh &mesh, const Input::Record in_rec)
 
virtual void initialize ()
 
virtual void zero_time_step ()
 
virtual ~EquationBase ()
 
virtual void update_solution ()
 
virtual void choose_next_time ()
 
virtual void set_time_upper_constraint (double dt, std::string message)
 
virtual void set_time_lower_constraint (double dt, std::string message)
 
TimeGovernortime ()
 
virtual void set_time_governor (TimeGovernor &time)
 
double planned_time ()
 
double solved_time ()
 
Meshmesh ()
 
TimeMark::Type mark_type ()
 
FieldSetdata ()
 
virtual void get_solution_vector (double *&vector, unsigned int &size)
 
virtual void get_parallel_solution_vector (Vec &vector)
 
virtual void output_data ()
 Write computed fields. More...
 

Protected Member Functions

virtual ModelEqDatadata ()=0
 Derived class should implement getter for ModelEqData instance. More...
 
void calculate_dispersivity_tensor (const arma::vec3 &velocity, const arma::mat33 &Dm, double alphaL, double alphaT, double water_content, double porosity, double cross_cut, arma::mat33 &K)
 

Static Protected Member Functions

static IT::Record get_input_type (const string &implementation, const string &description)
 

Protected Attributes

bool flux_changed
 Indicator of change in advection vector field. More...
 
SubstanceList substances_
 Transported substances. More...
 
vector< unsigned int > subst_idx
 List of indices used to call balance methods for a set of quantities. More...
 
double solvent_density_
 Density of liquid (a global constant). More...
 
const MH_DofHandlermh_dh
 
std::shared_ptr< OutputTimeoutput_stream_
 
- Protected Attributes inherited from EquationBase
bool equation_empty_
 flag is true if only default constructor was called More...
 
Meshmesh_
 
TimeGovernortime_
 
Input::Record input_record_
 
FieldSeteq_data_
 
std::shared_ptr< Balancebalance_
 object for calculation and writing the mass balance to file. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ConcentrationTransportBase
static Input::Type::Abstractget_input_type ()
 Common specification of the input record for secondary equations. More...
 

Detailed Description

Definition at line 49 of file concentration_model.hh.

Member Typedef Documentation

Definition at line 100 of file concentration_model.hh.

Constructor & Destructor Documentation

ConcentrationTransportModel::ConcentrationTransportModel ( Mesh mesh,
const Input::Record in_rec 
)

Definition at line 163 of file concentration_model.cc.

ConcentrationTransportModel::~ConcentrationTransportModel ( )
override

Definition at line 370 of file concentration_model.cc.

Member Function Documentation

void ConcentrationTransportModel::calculate_dispersivity_tensor ( const arma::vec3 velocity,
const arma::mat33 Dm,
double  alphaL,
double  alphaT,
double  water_content,
double  porosity,
double  cross_cut,
arma::mat33 K 
)
protected

Formula to calculate the dispersivity tensor.

Parameters
velocityFluid velocity.
DmMolecular diffusivity.
alphaLLongitudal dispersivity.
alphaTTransversal dispersivity.
porosityPorosity.
cross_cutCross-section.
KDispersivity tensor (output).

Definition at line 218 of file concentration_model.cc.

Here is the caller graph for this function:

void ConcentrationTransportModel::compute_advection_diffusion_coefficients ( const std::vector< arma::vec3 > &  point_list,
const std::vector< arma::vec3 > &  velocity,
const ElementAccessor< 3 > &  ele_acc,
std::vector< std::vector< arma::vec3 > > &  ad_coef,
std::vector< std::vector< arma::mat33 > > &  dif_coef 
)
overridevirtual

Compute coefficients of stiffness matrix.

Parameters
point_listPoints at which to evaluate.
velocityVelocity field (input). Temporary solution before we can pass data from other equations.
ele_accElement accessor.
ad_coefCoefficients of advection (output).
dif_coefCoefficients of diffusion (output).

Implements AdvectionDiffusionModel.

Definition at line 255 of file concentration_model.cc.

void ConcentrationTransportModel::compute_init_cond ( const std::vector< arma::vec3 > &  point_list,
const ElementAccessor< 3 > &  ele_acc,
std::vector< std::vector< double > > &  init_values 
)
overridevirtual

Compute initial conditions.

Parameters
point_listPoints at which to evaluate.
ele_accElement accessor.
init_valuesVector of intial values (output).

Implements AdvectionDiffusionModel.

Definition at line 286 of file concentration_model.cc.

void ConcentrationTransportModel::compute_mass_matrix_coefficient ( const std::vector< arma::vec3 > &  point_list,
const ElementAccessor< 3 > &  ele_acc,
std::vector< double > &  mm_coef 
)
overridevirtual

Compute coefficients of mass matrix.

Parameters
point_listPoints at which to evaluate.
ele_accElement accessor.
mm_coefCoefficient vector (output).

Implements AdvectionDiffusionModel.

Definition at line 177 of file concentration_model.cc.

void ConcentrationTransportModel::compute_retardation_coefficient ( const std::vector< arma::vec3 > &  point_list,
const ElementAccessor< 3 > &  ele_acc,
std::vector< std::vector< double > > &  ret_coef 
)
overridevirtual

Compute retardation coefficients due to sorption.

Parameters
point_listPoints at which to evaluate.
ele_accElement accessor.
ret_coefCoefficient vector (output).

Implements AdvectionDiffusionModel.

Definition at line 192 of file concentration_model.cc.

void ConcentrationTransportModel::compute_source_coefficients ( const std::vector< arma::vec3 > &  point_list,
const ElementAccessor< 3 > &  ele_acc,
std::vector< std::vector< double > > &  sources_conc,
std::vector< std::vector< double > > &  sources_density,
std::vector< std::vector< double > > &  sources_sigma 
)
overridevirtual

Compute coefficients of volume sources.

Parameters
point_listPoints at which to evaluate.
ele_accElement accessor.
sources_concSource concentrations (output).
sources_densitySource densities (output).
sources_sigmaSource sigmas (output).

Implements AdvectionDiffusionModel.

Definition at line 329 of file concentration_model.cc.

void ConcentrationTransportModel::compute_sources_sigma ( const std::vector< arma::vec3 > &  point_list,
const ElementAccessor< 3 > &  ele_acc,
std::vector< std::vector< double > > &  sources_sigma 
)
overridevirtual

Compute coefficients of volume sources.

Parameters
point_listPoints at which to evaluate.
ele_accElement accessor.
sources_sigmaSource sigmas (output).

Implements AdvectionDiffusionModel.

Definition at line 353 of file concentration_model.cc.

virtual ModelEqData& ConcentrationTransportModel::data ( )
protectedpure virtual

Derived class should implement getter for ModelEqData instance.

Here is the caller graph for this function:

void ConcentrationTransportModel::get_bc_type ( const ElementAccessor< 3 > &  ele_acc,
arma::uvec &  bc_types 
)
overridevirtual

Return types of boundary conditions for each solution component.

Parameters
ele_accElement accessor.
bc_typesVector of bc. types (output, see BC_Type)

Implements AdvectionDiffusionModel.

Definition at line 294 of file concentration_model.cc.

void ConcentrationTransportModel::get_flux_bc_data ( unsigned int  index,
const std::vector< arma::vec3 > &  point_list,
const ElementAccessor< 3 > &  ele_acc,
std::vector< double > &  bc_flux,
std::vector< double > &  bc_sigma,
std::vector< double > &  bc_ref_value 
)
overridevirtual

Return data for diffusive or total flux b.c.

The flux can in general take the form

cross_section*(flux + sigma*(solution - ref_value))

Parameters
indexComponent index.
point_listPoints at which to evaluate.
ele_accElement accessor.
bc_fluxNeumann flux (output).
bc_sigmaTransition parameter (output).
bc_ref_valueReference value (output).

Implements AdvectionDiffusionModel.

Definition at line 305 of file concentration_model.cc.

void ConcentrationTransportModel::get_flux_bc_sigma ( unsigned int  index,
const std::vector< arma::vec3 > &  point_list,
const ElementAccessor< 3 > &  ele_acc,
std::vector< double > &  bc_sigma 
)
overridevirtual

Return transition coefficient for flux b.c.

In assembly of system matrix one does not teed all data for total/diffusive flux b.c. This method therefore returns only the sigma coefficient.

Parameters
indexComponent index.
point_listPoints at which to evaluate.
ele_accElement accessor.
bc_sigmaTransition parameter (output).

Implements AdvectionDiffusionModel.

Definition at line 320 of file concentration_model.cc.

IT::Record ConcentrationTransportModel::get_input_type ( const string &  implementation,
const string &  description 
)
staticprotected

Create input type that can be passed to the derived class.

Parameters
implementationString characterizing the numerical method, e.g. DG, FEM, FVM.
descriptionComment used to describe the record key.
Returns

Definition at line 143 of file concentration_model.cc.

const vector<unsigned int>& ConcentrationTransportModel::get_subst_idx ( )
inlineoverridevirtual

Return substance indices used in balance.

Implements ConcentrationTransportBase.

Definition at line 184 of file concentration_model.hh.

void ConcentrationTransportModel::init_from_input ( const Input::Record in_rec)
overridevirtual

Read necessary data from input record.

Implements AdvectionDiffusionModel.

Definition at line 170 of file concentration_model.cc.

unsigned int ConcentrationTransportModel::n_substances ( )
inlineoverridevirtual

Returns number of transported substances.

Implements ConcentrationTransportBase.

Definition at line 170 of file concentration_model.hh.

Here is the caller graph for this function:

std::shared_ptr<OutputTime> ConcentrationTransportModel::output_stream ( )
inlineoverridevirtual

Getter for output stream.

Implements ConcentrationTransportBase.

Definition at line 190 of file concentration_model.hh.

void ConcentrationTransportModel::set_balance_object ( std::shared_ptr< Balance balance)
overridevirtual

Use Balance object from upstream equation (e.g. in various couplings) instead of own instance.

Implements ConcentrationTransportBase.

Definition at line 374 of file concentration_model.cc.

void ConcentrationTransportModel::set_output_stream ( std::shared_ptr< OutputTime stream)
inlinevirtual

Setter for output stream.

Implements ConcentrationTransportBase.

Definition at line 187 of file concentration_model.hh.

void ConcentrationTransportModel::set_target_time ( double  target_time)
inlineoverridevirtual

Set time interval which is considered as one time step by TransportOperatorSplitting. In particular the velocity field dosn't change over this interval.

Dependencies:

velocity, porosity -> matrix, source_vector matrix -> time_step

data_read_times -> time_step (not necessary if we won't stick to jump times) data -> source_vector time_step -> scaling

Implements ConcentrationTransportBase.

Definition at line 180 of file concentration_model.hh.

void ConcentrationTransportModel::set_velocity_field ( const MH_DofHandler dh)
inlineoverridevirtual

Updates the velocity field which determines some coefficients of the transport equation.

Parameters
dhmixed hybrid dof handler

(So far it does not work since the flow module returns a vector of zeros.)

Parameters
velocity_vectorInput array of velocity values.

Implements ConcentrationTransportBase.

Definition at line 163 of file concentration_model.hh.

SubstanceList& ConcentrationTransportModel::substances ( )
inlineoverridevirtual

Returns reference to the vector of substance names.

Implements ConcentrationTransportBase.

Definition at line 174 of file concentration_model.hh.

Member Data Documentation

bool ConcentrationTransportModel::flux_changed
protected

Indicator of change in advection vector field.

Definition at line 228 of file concentration_model.hh.

const MH_DofHandler* ConcentrationTransportModel::mh_dh
protected

Temporary solution how to pass velocity field form the flow model. TODO: introduce FieldDiscrete -containing true DOFHandler and data vector and pass such object together with other data. Possibly make more general set_data method, allowing setting data given by name. needs support from EqDataBase.

Definition at line 244 of file concentration_model.hh.

std::shared_ptr<OutputTime> ConcentrationTransportModel::output_stream_
protected

Definition at line 246 of file concentration_model.hh.

double ConcentrationTransportModel::solvent_density_
protected

Density of liquid (a global constant).

Definition at line 237 of file concentration_model.hh.

vector<unsigned int> ConcentrationTransportModel::subst_idx
protected

List of indices used to call balance methods for a set of quantities.

Definition at line 234 of file concentration_model.hh.

SubstanceList ConcentrationTransportModel::substances_
protected

Transported substances.

Definition at line 231 of file concentration_model.hh.


The documentation for this class was generated from the following files: