Flow123d  jenkins-Flow123d-windows32-release-multijob-51
semchem_interface.hh
Go to the documentation of this file.
1 #ifndef interfaceH
2  #define interfaceH
3 
4 #include "mesh/elements.h"
5 #include "la/distribution.hh"
6 #include <string.h>
7 #include <./input/input_type.hh>
8 #include "fields/field.hh"
9 
10 class Distribution;
11 
12 
14 
15 class Specie
16 {
17 public:
18  /*
19  * Static variable for new input data types input
20  */
22  /*
23  * Constructor.
24  */
25  Specie();
26 private:
27  /*
28  * Identifier.
29  */
30  int id;
31  /*
32  * Electrical charge.
33  */
34  double el_charge;
35  /*
36  * Partial Gib's energy.
37  */
38  double dGf;
39  /*
40  * Partial free enthalpy.
41  */
42  double dHf;
43  /*
44  * Molar mass.
45  */
46  double molar_mass;
47  /*
48  * Activity.
49  */
50  double activity;
51 };
52 
54 {
55 public:
56  /*
57  * Static variable for new input data types input
58  */
60  /*
61  * Constructor.
62  */
64 private:
65  /*
66  * Specification of type of reaction.
67  */
69  /*
70  * Defines species participating reaction.
71  */
73  /*
74  * Stechiometric coeficients describing reaction under consideration.
75  */
77  /*
78  * Reaction orders of all the reactants.
79  */
81  /*
82  * Kinetic constant describing reaction rate.
83  */
85  /*
86  * Appropriate constant describing chemical equilibrium.
87  */
89 
90 };
91 
93 {
94  public:
95  /*
96  * Static variable for new input data types input
97  */
99  /**
100  * Semchem interface is the tool to call a simulation of chemical reactions as a part of transport model. timeStep defines the length of time step for simulation of chemical reactions. nrOfSpecies is the number of transported species. dualPorosity defines type of porosity in examinated soil.
101  */
102  Semchem_interface(double timeStep, Mesh * mesh, int nrOfSpecies, bool dualPorosity); //(int nrOfElements, double ***ConcentrationMatrix, Mesh *mesh);
103  /**
104  * @brief Sets pointer to data of other equations.
105  * @param cross_section is pointer to cross_section data of Darcy flow equation
106  */
108 
110  Field<3, FieldValue<3>::Scalar> *por_imm_,
111  Field<3, FieldValue<3>::Scalar> *phi_);
112  /**
113  * This method has been prepared to enable simulation of chemical reactions via Semchem. porTyp defines type of porosity. ppelm is a pointer to element we want to simulate chemistry in. poradi is ID of such element. conc is a pointer to threedimensional array full of doubles.
114  */
115  void compute_reaction(bool porTyp, ElementIter ppelm, int poradi, double ***conc);
116  /**
117  * The function update_solution(..) calls compute_reaction(..) for every single element in the mesh.
118  */
119  void update_solution(void);
120  /**
121  * This method reads from ini-file the information if a simulation of chemical raections is switched on.
122  */
123  void set_chemistry_computation(void);
124  /**
125  * This method enables to change the length of time step for simulation of chemical reactions.
126  */
127  void set_timestep(double new_timestep);
128  /**
129  * This method reads from ini-file an information if dual porosity is considered in examinated soil.
130  */
131  void set_dual_porosity(void);
132  /**
133  * This method sets the number of elements contained in mesh.
134  */
135  void set_nr_of_elements(int nrOfElements);
136  /**
137  * This method sets the pointer to a three dimensional array of doubles.
138  */
139  void set_concentration_matrix(double ***ConcentrationsMatrix, Distribution *conc_distr, int *el_4_loc);
140  /**
141  * This method sets the pointer to a one dimensional array for converting IDs from local to global.
142  */
143  void set_el_4_loc(int *el_for_loc);
144  /**
145  * This method sets a pointer to mesh describing examinated area.
146  */
147  void set_mesh_(Mesh *mesh);
148  /**
149  * function to set path to an outputfile for semchem-module.
150  */
151  void set_fw_chem(std::string semchem_output_file); //(const char* semchem_output_file);
152  /**
153  * It containes an information if the simulation of chemical reactions is switched on.
154  */
156  /**
157  * It containes an information if the dual porosity is switched on.
158  */
160  /**
161  * It containes an information about how many elements are contained in mesh.
162  */
164  /**
165  * It is a pointer on three dimensional matrix full of doubles.
166  */
168  /**
169  * It is name of an output file for semchem.
170  */
171  char *fw_chem;
172  private:
173  /**
174  * It holds an information about the length of time step for chemical reaction simulation.
175  */
176  double time_step;
177  /**
178  * It is a pointer on mesh.
179  */
181  /**
182  * It describes partitioning of elements between processors.
183  */
185  /**
186  * It enables to change local IDs of elements in mesh into global IDs.
187  */
188  int *el_4_loc;
189  /**
190  * pointer to cross_section data (gets from flow->transport->semchem), for computing element volume
191  */
193 
194  /// pointers to sorption fields from transport
196 };
197 #endif
type_of_reaction
void set_el_4_loc(int *el_for_loc)
Semchem_interface(double timeStep, Mesh *mesh, int nrOfSpecies, bool dualPorosity)
Class template representing a field with values dependent on: point, element, and region...
Definition: field.hh:48
void compute_reaction(bool porTyp, ElementIter ppelm, int poradi, double ***conc)
void update_solution(void)
Definition: mesh.h:108
Distribution * distribution
void set_nr_of_elements(int nrOfElements)
void set_cross_section(Field< 3, FieldValue< 3 >::Scalar > *cross_section)
Sets pointer to data of other equations.
static Input::Type::Record input_type
Field< 3, FieldValue< 3 >::Scalar > * por_imm
double molar_mass
void set_dual_porosity(void)
Field< 3, FieldValue< 3 >::Scalar > * phi
Class for declaration of polymorphic Record.
Definition: type_record.hh:463
void set_mesh_(Mesh *mesh)
static Input::Type::Record input_type
double *** concentration_matrix
static Input::Type::AbstractRecord input_type
void set_sorption_fields(Field< 3, FieldValue< 3 >::Scalar > *por_m_, Field< 3, FieldValue< 3 >::Scalar > *por_imm_, Field< 3, FieldValue< 3 >::Scalar > *phi_)
void set_timestep(double new_timestep)
Support classes for parallel programing.
double el_charge
void set_fw_chem(std::string semchem_output_file)
type_of_reaction type
Field< 3, FieldValue< 3 >::Scalar > * por_m
pointers to sorption fields from transport
void set_chemistry_computation(void)
void set_concentration_matrix(double ***ConcentrationsMatrix, Distribution *conc_distr, int *el_4_loc)
Record type proxy class.
Definition: type_record.hh:161
Field< 3, FieldValue< 3 >::Scalar > * cross_section
double activity