Flow123d  release_2.2.0-36-g163dc99
isotherm.cc
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file isotherm.cc
15  * @brief
16  */
17 
18 #include <utility>
19 
20 #include "reaction/isotherm.hh"
21 
22 void Isotherm::make_table(int nr_of_points)
23 {
24  if(table_limit_ > 0.0) switch(adsorption_type_)
25  {
26  case 0: // none
27  {
28  None obj_isotherm;
29  make_table(obj_isotherm, 1);
30  }
31  break;
32  case 1: // linear:
33  {
34  Linear obj_isotherm(mult_coef_);
35  make_table(obj_isotherm, nr_of_points);
36  }
37  break;
38  case 2: // freundlich:
39  {
40  Freundlich obj_isotherm(mult_coef_, second_coef_);
41  make_table(obj_isotherm, nr_of_points);
42  }
43  break;
44  case 3: // langmuir:
45  {
46  Langmuir obj_isotherm(mult_coef_, second_coef_);
47  make_table(obj_isotherm, nr_of_points);
48  }
49  break;
50  default:
51  {
52  ;
53  }
54  break;
55  }
56  return;
57 }
58 
59 
61 {
62  return c_pair;
63 }
64 
65 template<> void Isotherm::make_table(const None &isotherm, int n_steps)
66 {
67  // Solve_conc returns the same, so we need to do that also in compute_projection.
68  // We set size of the table to 1, so it follow the conditions into solve_conc again.
69 
70  limited_solubility_on_ = false; // so it cannot go in precipitate function
71 
72  total_mass_step_ = 1; // set just one step in the table, so we void zero division
73  interpolation_table.resize(1,0); // set one value in the table so the condition in compute_projection fails
74  return;
75 }
double mult_coef_
Multiplication parameter of the isotherm.
Definition: isotherm.hh:263
double second_coef_
Optional secod parameter of the isotherm.
Definition: isotherm.hh:266
Definition: isotherm.hh:84
ConcPair solve_conc(ConcPair c_pair, const Func &isotherm)
Definition: isotherm.hh:412
double total_mass_step_
Definition: isotherm.hh:292
vector< double > interpolation_table
Definition: isotherm.hh:288
bool limited_solubility_on_
Solubility limit flag.
Definition: isotherm.hh:274
Pair of soluted and adsorbed concentration.
Definition: isotherm.hh:178
void make_table(int n_points)
Definition: isotherm.cc:22
double table_limit_
Definition: isotherm.hh:271
enum SorptionType adsorption_type_
Type of isotherm.
Definition: isotherm.hh:260
Other possible transformation of coordinates: