OpenLB 1.7
Loading...
Searching...
No Matches
isotherm.h
Go to the documentation of this file.
1/* Lattice Boltzmann sample, written in C++, using the OpenLB
2 * library
3 *
4 * Copyright (C) 2022 Florian Raichle
5 * E-mail contact: info@openlb.net
6 * The most recent release of OpenLB can be downloaded at
7 * <http://www.openlb.net/>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public
20 * License along with this program; if not, write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
23 */
24
25
26#ifndef OLB_APPS_FLORIAN_ADSORPTION3D_PHOSPHATEREACTION_H_
27#define OLB_APPS_FLORIAN_ADSORPTION3D_PHOSPHATEREACTION_H_
28
29#include <vector>
30#include <cmath>
31#include <iostream>
32
33namespace olb {
34
41template<typename T>
42class Isotherm {
43public:
55
59virtual T getLoading(T c) const = 0;
60
62 return 1;
63};
64
66 return 1;
67};
68
69void print(std::ostream& clout) const {
70 clout << "Isotherm exponent n= " << this->isoKonstB << std::endl;
71 clout << "Isotherm factor K= " << this->isoKonstA << std::endl;
72 clout << "-------------------------------------------------------------" << std::endl;
73}
74};
75
76template<typename T>
77class LinearIsotherm: public Isotherm<T> {
78 public:
80
81 T getLoading(T c) const override {
82 return this->isoKonstA * c;
83 }
84};
85
86template<typename T>
87class LangmuirIsotherm: public Isotherm<T> {
88 public:
90
91 T getLoading(T c) const override {
92 return this->isoKonstA*this->isoKonstB*c/(1+this->isoKonstB*c);
93 }
94};
95
96template<typename T>
97class FreundlichIsotherm: public Isotherm<T> {
98 public:
100
101 T getLoading(T c) const override {
102 return this->isoKonstA * std::pow(c, this->isoKonstB);
103 }
104};
105
106}
107#endif
FreundlichIsotherm(T isoKonstA, T isoKonstB)
Definition isotherm.h:99
T getLoading(T c) const override
Equation for isotherm.
Definition isotherm.h:101
Base class for isotherms.
Definition isotherm.h:42
virtual T getConversionFactorKonstA()
Definition isotherm.h:61
Isotherm(T isoKonstA, T isoKonstB)
Base class for Isotherm objects.
Definition isotherm.h:52
virtual T getLoading(T c) const =0
Equation for isotherm.
void print(std::ostream &clout) const
Definition isotherm.h:69
virtual T getConversionFactorKonstB()
Definition isotherm.h:65
LangmuirIsotherm(T isoKonstA, T isoKonstB)
Definition isotherm.h:89
T getLoading(T c) const override
Equation for isotherm.
Definition isotherm.h:91
LinearIsotherm(T isoKonstA, T isoKonstB)
Definition isotherm.h:79
T getLoading(T c) const override
Equation for isotherm.
Definition isotherm.h:81
Top level namespace for all of OpenLB.