Flow123d
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 //#include "fields/field_values.hh"
10 
11 class Distribution;
12 
13 
15 
16 class Specie
17 {
18  public:
19  /*
20  * Static variable for new input data types input
21  */
23  /*
24  * Constructor.
25  */
26  Specie();
27  private:
28  /*
29  * Identifier.
30  */
31  int id;
32  /*
33  * Electrical charge.
34  */
35  double el_charge;
36  /*
37  * Partial Gib's energy.
38  */
39  double dGf;
40  /*
41  * Partial free enthalpy.
42  */
43  double dHf;
44  /*
45  * Molar mass.
46  */
47  double molar_mass;
48  /*
49  * Activity.
50  */
51  double activity;
52 };
53 
55 {
56  public:
57  /*
58  * Static variable for new input data types input
59  */
61  /*
62  * Constructor.
63  */
65  private:
66  /*
67  * Specification of type of reaction.
68  */
70  /*
71  * Defines species participating reaction.
72  */
74  /*
75  * Stechiometric coeficients describing reaction under consideration.
76  */
78  /*
79  * Reaction orders of all the reactants.
80  */
82  /*
83  * Kinetic constant describing reaction rate.
84  */
86  /*
87  * Appropriate constant describing chemical equilibrium.
88  */
90 
91 };
92 
94 {
95  public:
96  /*
97  * Static variable for new input data types input
98  */
100  /**
101  * 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.
102  */
103  Semchem_interface(double timeStep, Mesh * mesh, int nrOfSpecies, bool dualPorosity); //(int nrOfElements, double ***ConcentrationMatrix, Mesh *mesh);
104  /**
105  * @brief Sets pointer to data of other equations.
106  * @param cross_section is pointer to cross_section data of Darcy flow equation
107  */
109 
111  Field<3, FieldValue<3>::Scalar> *por_imm_,
112  Field<3, FieldValue<3>::Scalar> *phi_);
113  /**
114  * 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.
115  */
116  void compute_reaction(bool porTyp, ElementIter ppelm, int poradi, double ***conc);
117  /**
118  * The function update_solution(..) calls compute_reaction(..) for every single element in the mesh.
119  */
120  void update_solution(void);
121  /**
122  * This method reads from ini-file the information if a simulation of chemical raections is switched on.
123  */
124  void set_chemistry_computation(void);
125  /**
126  * This method enables to change the length of time step for simulation of chemical reactions.
127  */
128  void set_timestep(double new_timestep);
129  /**
130  * This method reads from ini-file an information if dual porosity is considered in examinated soil.
131  */
132  void set_dual_porosity(void);
133  /**
134  * This method sets the number of elements contained in mesh.
135  */
136  void set_nr_of_elements(int nrOfElements);
137  /**
138  * This method sets the pointer to a three dimensional array of doubles.
139  */
140  void set_concentration_matrix(double ***ConcentrationsMatrix, Distribution *conc_distr, int *el_4_loc);
141  /**
142  * This method sets the pointer to a one dimensional array for converting IDs from local to global.
143  */
144  void set_el_4_loc(int *el_for_loc);
145  /**
146  * This method sets a pointer to mesh describing examinated area.
147  */
148  void set_mesh_(Mesh *mesh);
149  /**
150  * function to set path to an outputfile for semchem-module.
151  */
152  void set_fw_chem(std::string semchem_output_file); //(const char* semchem_output_file);
153  /**
154  * It containes an information if the simulation of chemical reactions is switched on.
155  */
157  /**
158  * It containes an information if the dual porosity is switched on.
159  */
161  /**
162  * It containes an information about how many elements are contained in mesh.
163  */
165  /**
166  * It is a pointer on three dimensional matrix full of doubles.
167  */
169  /**
170  * It is name of an output file for semchem.
171  */
172  char *fw_chem;
173  private:
174  /**
175  * It holds an information about the length of time step for chemical reaction simulation.
176  */
177  double time_step;
178  /**
179  * It is a pointer on mesh.
180  */
182  /**
183  * It describes partitioning of elements between processors.
184  */
186  /**
187  * It enables to change local IDs of elements in mesh into global IDs.
188  */
189  int *el_4_loc;
190  /**
191  * pointer to cross_section data (gets from flow->transport->semchem), for computing element volume
192  */
194 
195  /// pointers to sorption fields from transport
197 };
198 #endif