Flow123d
sorption_dual.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <cstring>
3 #include <stdlib.h>
4 #include <math.h>
5 #include <boost/foreach.hpp>
6 
7 //#include "reaction/reaction.hh"
8 //#include "reaction/isotherm.hh"
10 //#include "system/system.hh"
11 //#include "system/sys_profiler.hh"
12 
13 //#include "la/distribution.hh"
14 #include "mesh/mesh.h"
15 //#include "mesh/elements.h"
16 //#include "mesh/region.hh"
17 
18 //#include "coupling/time_governor.hh"
19 
20 
21 
22 using namespace std;
23 
25  : SorptionBase(init_mesh, in_rec)
26 {
27 }
28 
30 {
31 }
32 
33 /*
34 void SorptionDual::isotherm_reinit(std::vector<Isotherm> &isotherms_vec, const ElementAccessor<3> &elem)
35 {
36  START_TIMER("SorptionMob::isotherm_reinit");
37 
38  double rock_density = data_.rock_density.value(elem.centre(),elem);
39 
40  double por_m = data_.porosity.value(elem.centre(),elem);
41  double por_imm = immob_porosity_.value(elem.centre(),elem);
42 
43  // List of types of isotherms in particular regions
44  arma::uvec adsorption_type = data_.sorption_types.value(elem.centre(),elem);
45  arma::Col<double> mult_coef_vec = data_.mult_coefs.value(elem.centre(),elem);
46  arma::Col<double> second_coef_vec = data_.second_params.value(elem.centre(),elem);
47 
48  for(int i_subst = 0; i_subst < n_substances_; i_subst++)
49  {
50  double mult_coef = mult_coef_vec[i_subst];
51  double second_coef = second_coef_vec[i_subst];
52  Isotherm & isotherm = isotherms_vec[i_subst];
53 
54  //scales are different for the case of sorption in mobile and immobile pores
55  double scale_aqua, scale_sorbed;
56  scale_aqua = por_imm;
57  scale_sorbed = compute_sorbing_scale(por_m,por_imm) * (1 - por_m - por_imm) * rock_density * molar_masses[i_subst];
58  if(scale_sorbed == 0.0)
59  xprintf(UsrErr, "Parameter scale_sorbed (phi * (1 - por_m - por_imm) * rock_density * molar_masses[i_subst]) is equal to zero.");
60  bool limited_solubility_on;
61  double table_limit;
62  if (solubility_vec_[i_subst] <= 0.0) {
63  limited_solubility_on = false;
64  table_limit=table_limit_[i_subst];
65 
66  } else {
67  limited_solubility_on = true;
68  table_limit=solubility_vec_[i_subst];
69  }
70  isotherm.reinit(Isotherm::SorptionType(adsorption_type[i_subst]), limited_solubility_on,
71  solvent_dens, scale_aqua, scale_sorbed, table_limit, mult_coef, second_coef);
72 
73  }
74 
75  END_TIMER("SorptionMob::isotherm_reinit");
76 
77  return;
78 }
79 */
80 /*
81 // Computes adsorption simulation over all the elements.
82 void SorptionDual::update_solution(void)
83 {
84  data_.set_time(*time_); // set to the last computed time
85  immob_porosity_.set_time(*time_);
86 
87  //if parameters changed during last time step, reinit isotherms and eventualy update interpolation tables in the case of constant rock matrix parameters
88  if(data_.changed()
89  || immob_porosity_.changed()
90  )
91  make_tables();
92 
93  START_TIMER("SorptionDual");
94  for (int loc_el = 0; loc_el < distribution->lsize(); loc_el++)
95  {
96  compute_reaction(concentration_matrix, loc_el);
97  }
98  END_TIMER("SorptionDual");
99 }
100 */