BioCMAMC-ST
acetate.hpp
1#ifndef __ACETATE_MODEL_HPP__
2#define __ACETATE_MODEL_HPP__
3
4#include "Kokkos_Assert.hpp"
5#include "Kokkos_Core_fwd.hpp"
6#include "Kokkos_Macros.hpp"
7#include "common/common.hpp"
8#include "common/traits.hpp"
9#include "mc/macros.hpp"
10#include "models/utils.hpp"
11#include <array>
12#include <mc/prng/prng_extension.hpp>
13#include <mc/traits.hpp>
14#include <optional>
15#include <string_view>
16
17namespace Models
18{
19
31 namespace Stoichiometry
32 {
33 inline constexpr double m_o2 = 32.0;
34 inline constexpr double m_cmol_glucose = 30.0;
35 inline constexpr double m_cmol_acetate = 30.0;
36 inline constexpr double m_cmol_biomass = 24.6;
37
39 inline constexpr double gamma_glucose = 4.0;
40 inline constexpr double gamma_acetate = 4.0;
41 inline constexpr double gamma_biomass = 4.2;
42
46 constexpr double
47 e_surplus(double m_cmol_sub, double gamma_sub, double y_x)
48 {
49 return gamma_sub / m_cmol_sub - gamma_biomass * y_x / m_cmol_biomass;
50 }
51
55 constexpr double
56 y_o2_ox(double m_cmol_sub, double gamma_sub, double y_x)
57 {
58 return m_o2 * e_surplus(m_cmol_sub, gamma_sub, y_x) / 4.0;
59 }
60
62 constexpr double
63 y_ac_fer(double m_cmol_sub, double gamma_sub, double y_x)
64 {
65 return m_cmol_acetate * e_surplus(m_cmol_sub, gamma_sub, y_x)
67 }
68 } // namespace Stoichiometry
69
90 struct Acetate
91 {
92 using uniform_weight = std::true_type;
93 using Self = Acetate;
94 using FloatType = float;
95 using Config = std::nullopt_t;
96
97 enum class particle_var : int // NOLINT
98 {
99 length = 0,
103 // Export
108 // Contributions
113 };
114
115 static constexpr std::size_t n_var
116 = INDEX_FROM_ENUM(particle_var::__COUNT__);
117
118 static constexpr std::string_view name = "acetate";
120
122 static constexpr std::size_t n_c = 3;
123
125
134 enum species_index : std::size_t
135 {
136 S = 0,
137 O2 = 1,
138 Ac = 2,
140 };
141
143 enum reaction_index : std::size_t
144 {
145 i_go = 0, // glucose oxidation
146 i_fe = 1, // glucose fermentation
147 i_ov = 2, // acetate overflow
148 i_ao = 3, // acetate oxidation
149 N_R = 4
150 };
151
152 using reaction_rates = Kokkos::Array<FloatType, N_R>;
153 using uptake_rates = Kokkos::Array<FloatType, N_N>;
154
155 MODEL_CONSTANT FloatType a_max_m = 2e-6 / 3600.; // m/s
156 MODEL_CONSTANT FloatType l_max_m = 2e-6; // m
157 MODEL_CONSTANT FloatType l_min_m = l_max_m / 2.; // m
158 MODEL_CONSTANT FloatType d_m = 0.6e-6; // m
159 MODEL_CONSTANT FloatType lin_density
160 = c_linear_density(static_cast<FloatType>(1000), d_m); // kg/m
161
163 MODEL_CONSTANT FloatType k_s = 1e-3;
165 MODEL_CONSTANT FloatType k_o = 1e-5;
166 MODEL_CONSTANT FloatType k_a = 1e-4;
167
168 // Stoichiometry, growth yields
169
170 MODEL_CONSTANT FloatType y_x_go = 0.5F;
171 MODEL_CONSTANT FloatType y_x_fe = 0.15F;
172 MODEL_CONSTANT FloatType y_x_ov = 0.0F;
173 MODEL_CONSTANT FloatType y_x_ao = 0.33F;
174
176 MODEL_CONSTANT FloatType y_o2_go = static_cast<FloatType>(
179 y_x_go));
181 MODEL_CONSTANT FloatType y_o2_ao = static_cast<FloatType>(
184 y_x_ao));
185
187 MODEL_CONSTANT FloatType y_ac_fe = static_cast<FloatType>(
190 y_x_fe));
192 MODEL_CONSTANT FloatType y_ac_ov = static_cast<FloatType>(
195 y_x_ov));
196
197 // A reaction cannot need a negative amount of O2 or acetate, nor build
198 // more carbon than its substrate carries.
199 static_assert(y_o2_go > 0.F
202 "i_go: y_x too high, negative O2 or CO2");
203 static_assert(y_o2_ao > 0.F
206 "i_ao: y_x too high, negative O2 or CO2");
207 static_assert(y_ac_fe > 0.F && y_ac_fe < y_ac_ov,
208 "i_fe: y_x too high, cannot grow and excrete as much acetate "
209 "as the pure overflow");
210
217 MODEL_CONSTANT FloatType f_o2_max = 1.2;
219 MODEL_CONSTANT FloatType f_ac_max = 1. / 3.;
220
221 MODEL_CONSTANT FloatType phi_s_max = a_max_m * lin_density / y_x_go; // kg/s
222
226 MODEL_CONSTANT FloatType x_c_max = 30.;
228 MODEL_CONSTANT FloatType f_pos = 2.;
230 MODEL_CONSTANT FloatType d_t_floor = 1e-30;
231
235 MODEL_CONSTANT FloatType a_p_min = 1e-3F * a_max_m;
236
241 MODEL_CONSTANT FloatType a_p_recovery = 0.25F;
242
243 MODEL_CONSTANT auto l_max_dist
245 l_max_m, l_max_m / 10., l_max_m * 0.7, 1.3 * l_max_m);
246
248 l_max_m * 0.75, l_max_m / 10., 0.7 * l_min_m, l_max_m * 1.3);
249
250 KOKKOS_INLINE_FUNCTION static void init(const MC::pool_type& random_pool,
251 std::size_t idx,
252 const SelfParticle& arr);
253
254 KOKKOS_INLINE_FUNCTION static MC::Status
255 update([[maybe_unused]] const MC::pool_type& random_pool,
256 FloatType d_t,
257 std::size_t idx,
258 const SelfParticle& arr,
259 const SelfContribs& arr_contribs,
260 std::size_t position_index,
261 const MC::LocalConcentration& c);
262
263 KOKKOS_INLINE_FUNCTION static void
264 division(const MC::pool_type& random_pool,
265 std::size_t idx,
266 std::size_t idx2,
267 const SelfParticle& arr,
268 const SelfParticle& buffer_arr);
269
277 KOKKOS_INLINE_FUNCTION static reaction_rates
278 metabolism(const uptake_rates& phi, FloatType nu_p, FloatType& nu);
279
280 KOKKOS_INLINE_FUNCTION static double
281 mass(std::size_t idx, const SelfParticle& arr)
282 {
283 return GET_PROPERTY(Self::particle_var::length) * lin_density;
284 }
285
286 static std::array<std::string_view, Self::n_var>
288 {
289 return {
290 "length", "l_max", "a_p", "a_max", "a_e", "a_go",
291 "a_fe", "a_ao", "phi_s", "phi_o2", "phi_a",
292 };
293 }
294
295 static std::array<std::string_view, Self::n_c>
297 {
298 return { "glucose", "O2", "acetate" };
299 }
300 };
301
302 CHECK_MODEL(Acetate)
303
304 KOKKOS_INLINE_FUNCTION void
305 Acetate::init([[maybe_unused]] const MC::pool_type& random_pool,
306 std::size_t idx,
307 const SelfParticle& arr)
308 {
309
310 MODEL_CONSTANT auto a_max_dist
312 a_max_m, a_max_m / 2., 0.5 * a_max_m, a_max_m * 1.5);
313
314 static constexpr auto ld = l_dist;
315 // static constexpr auto lm = l_dist;
316 auto gen = random_pool.get_state();
317 GET_PROPERTY(particle_var::length) = ld.draw(gen);
318 GET_PROPERTY(particle_var::l_max) = l_max_m;
319 GET_PROPERTY(particle_var::a_p) = a_max_m / 2.;
320 GET_PROPERTY(particle_var::a_max) = a_max_dist.mean();
321 random_pool.free_state(gen);
322
323 GET_PROPERTY(particle_var::a_e) = 0.;
324 GET_PROPERTY(particle_var::a_go) = 0.;
325 GET_PROPERTY(particle_var::a_fe) = 0.;
326 GET_PROPERTY(particle_var::a_ao) = 0.;
327 GET_PROPERTY(particle_var::phi_s) = 0.;
328 GET_PROPERTY(particle_var::phi_o2) = 0.;
329 GET_PROPERTY(particle_var::phi_a) = 0.;
330 }
331
332 KOKKOS_INLINE_FUNCTION Acetate::reaction_rates
334 const FloatType nu_p,
335 FloatType& nu)
336 {
337 constexpr auto zero = static_cast<FloatType>(0);
338 reaction_rates r = {}; // zero initialised
339
340 // i_go: respiration, highest priority. Bounded by the glucose, by the
341 // oxygen and by the
342 // growth capacity.
343 const FloatType s_ox_max = Kokkos::min(phi[S], phi[O2] / y_o2_go); // kgS/s
344 r[i_go] = Kokkos::min(s_ox_max, nu_p / y_x_go);
345 nu = r[i_go] * y_x_go;
346
347 // i_ov: overflow. Glucose that oxygen could have supported but that the
348 // growth capacity cannot handle, excreted as acetate. a_p driven branch.
349 r[i_ov] = Kokkos::max(s_ox_max - r[i_go], zero);
350
351 // i_ao: acetate re-uptake, on the oxygen and on the growth capacity left
352 // over by i_go. so
353 // acetate is never produced and consumed at the same time.
354 const FloatType o2_res = Kokkos::max(phi[O2] - (r[i_go] * y_o2_go), zero);
355 r[i_ao] = Kokkos::min(Kokkos::min(phi[Ac], o2_res / y_o2_ao),
356 Kokkos::max(nu_p - nu, zero) / y_x_ao);
357 nu += r[i_ao] * y_x_ao;
358
359 // i_fe: fermentation, lowest priority.
360 const FloatType s_res = Kokkos::max(phi[S] - r[i_go] - r[i_ov], zero);
361 r[i_fe] = Kokkos::min(s_res, Kokkos::max(nu_p - nu, zero) / y_x_fe);
362 nu += r[i_fe] * y_x_fe;
363
364 KOKKOS_ASSERT(r[i_go] >= zero);
365 KOKKOS_ASSERT(r[i_fe] >= zero);
366 KOKKOS_ASSERT(r[i_ov] >= zero);
367 KOKKOS_ASSERT(r[i_ao] >= zero);
368 KOKKOS_ASSERT(nu >= zero && nu <= nu_p * static_cast<FloatType>(1.001));
369 // No reaction may draw more than the uptake made available: this is what
370 // carries the uptake cap over to the liquid contributions
371 KOKKOS_ASSERT(r[i_go] + r[i_fe] + r[i_ov]
372 <= phi[S] * static_cast<FloatType>(1.001));
373 KOKKOS_ASSERT((r[i_go] * y_o2_go) + (r[i_ao] * y_o2_ao)
374 <= phi[O2] * static_cast<FloatType>(1.001));
375 KOKKOS_ASSERT(r[i_ao] <= phi[Ac] * static_cast<FloatType>(1.001));
376
377 return r;
378 }
379
380 KOKKOS_INLINE_FUNCTION MC::Status
381 Acetate::update([[maybe_unused]] const MC::pool_type& random_pool,
382 FloatType d_t,
383 std::size_t idx,
384 const SelfParticle& arr,
385 const SelfContribs& arr_contribs,
386 const std::size_t position_index,
387 const MC::LocalConcentration& c)
388 {
389 const auto c_s = GET_CLAMPED_CONCENTRATION_CAST(FloatType, S);
390 const auto c_o2 = GET_CLAMPED_CONCENTRATION_CAST(FloatType, O2);
391 const auto c_ac = GET_CLAMPED_CONCENTRATION_CAST(FloatType, Ac);
392
393 const FloatType phi_s_max_p
394 = GET_PROPERTY(particle_var::a_max) * lin_density / y_x_go;
395 const FloatType phi_o2_max_p = f_o2_max * y_o2_go * phi_s_max_p;
396 const FloatType phi_ac_max_p = f_ac_max * phi_s_max_p;
397
398 // Largest uptake one cell may take from the compartment during this step
399 // without the explicit liquid update going negative
400 const FloatType share = (GET_PROPERTY(particle_var::length) * lin_density)
401 / ((f_pos * x_c_max * d_t) + d_t_floor);
402
403 // Monod uptake potentials [kg/s].
404 uptake_rates phi{};
405 phi[S] = phi_s_max_p * c_s / (c_s + k_s);
406 phi[O2] = Kokkos::min(phi_o2_max_p * c_o2 / (c_o2 + k_o), share * c_o2);
407 phi[Ac] = Kokkos::min(phi_ac_max_p * c_ac / (c_ac + k_a), share * c_ac);
408
409 // Growth capacity of the individual, in ]0, a_max] by division()
410 const FloatType nu_p = GET_PROPERTY(particle_var::a_p) * lin_density;
411
412 FloatType nu = 0.F;
413 const reaction_rates r = metabolism(phi, nu_p, nu);
414
415 constexpr FloatType inv_lin_density
416 = static_cast<FloatType>(1) / lin_density;
417 const FloatType a_e = nu * inv_lin_density;
418
419 GET_PROPERTY(particle_var::a_e) = a_e;
420 GET_PROPERTY(particle_var::a_go) = r[i_go] * y_x_go * inv_lin_density;
421 GET_PROPERTY(particle_var::a_fe) = r[i_fe] * y_x_fe * inv_lin_density;
422 GET_PROPERTY(particle_var::a_ao) = r[i_ao] * y_x_ao * inv_lin_density;
423
424 GET_PROPERTY(particle_var::length) += d_t * a_e;
425
426 // Glucose: consumed by respiration, fermentation and overflow
427 const FloatType phi_s = -(r[i_go] + r[i_fe] + r[i_ov]);
428 // Oxygen: only consumed, it is fed to the liquid by the gas/liquid transfer
429 const FloatType phi_o2 = -((r[i_go] * y_o2_go) + (r[i_ao] * y_o2_ao));
430 // Acetate: produced by fermentation (O2 limited) and by overflow (a_p
431 // limited), consumed by acetate oxidation
432 const FloatType phi_a
433 = ((r[i_fe] * y_ac_fe) + (r[i_ov] * y_ac_ov)) - r[i_ao];
434
435 GET_PROPERTY(particle_var::phi_s) = phi_s;
436 GET_PROPERTY(particle_var::phi_o2) = phi_o2;
437 GET_PROPERTY(particle_var::phi_a) = phi_a;
438
439 GET_CONTRIBS(S) = phi_s;
440 GET_CONTRIBS(O2) = phi_o2;
441 GET_CONTRIBS(Ac) = phi_a;
442
443 return check_div(GET_PROPERTY(Self::particle_var::length),
444 GET_PROPERTY(Self::particle_var::l_max));
445 }
446
447 KOKKOS_INLINE_FUNCTION void
448 Acetate::division([[maybe_unused]] const MC::pool_type& random_pool,
449 std::size_t idx,
450 std::size_t idx2,
451 const SelfParticle& arr,
452 const SelfParticle& buffer_arr)
453 {
454 Kokkos::View<FloatType**,
455 ComputeSpace::array_layout,
456 Kokkos::MemoryTraits<Kokkos::MemoryTraitsFlags::Restrict>>
457 buffer_e = buffer_arr;
458
459 const FloatType current_l = GET_PROPERTY(particle_var::length);
460 const FloatType new_current_length = current_l / 2.F;
461 GET_PROPERTY(particle_var::length) = new_current_length;
462 constexpr auto binf = INDEX_FROM_ENUM(particle_var::length);
463 constexpr auto bsup = INDEX_FROM_ENUM(particle_var::a_e);
464 for (auto i = binf; i < bsup; ++i)
465 {
466 COPY_PROPERTY_TO(i, idx2, buffer_e);
467 }
468
469 // Local copies: nvcc rejects a static constexpr member passed by reference
470 // to Kokkos::min/max/clamp ("undefined in device code")
471 const FloatType ap_min = a_p_min;
472 const FloatType a_max_i
473 = Kokkos::max(GET_PROPERTY(particle_var::a_max), ap_min);
474
475 // Effective elongation of the mother, floored: a fully starved cell would
476 // otherwise give log(0)
477 const FloatType a_e_i
478 = Kokkos::clamp(GET_PROPERTY(particle_var::a_e), ap_min, a_max_i);
479
480 // Centre of the redistribution. a_e <= a_p always holds, so centring on
481 // a_e alone makes the capacity of a lineage a decreasing sequence that
482 // converges to 0; the pull toward a_max keeps a_p away from 0 and lets a
483 // starved lineage recover when the environment improves.
484 const FloatType a_target = a_e_i + (a_p_recovery * (a_max_i - a_e_i));
485
486 auto gen = random_pool.get_state();
487 const double sigma = 0.2;
488 const double average
489 = Kokkos::log(static_cast<double>(a_target)) - sigma * sigma / 2;
490 const auto dist = MC::Distributions::LogNormal<double>(average, sigma);
491
492 // Clamped to [a_p_min, a_max]: a null capacity freezes the sub-lineage for
493 // the rest of the run
494 const auto gen1 = Kokkos::clamp(
495 static_cast<FloatType>(dist.draw(gen)), ap_min, a_max_i);
496 const auto gen2 = Kokkos::clamp(
497 static_cast<FloatType>(dist.draw(gen)), ap_min, a_max_i);
498
499 static constexpr auto local_l = l_max_dist;
500 const FloatType lmax1 = local_l.draw(gen);
501 const FloatType lmax2 = local_l.draw(gen);
502
503 GET_PROPERTY(particle_var::a_p) = gen1;
504 GET_PROPERTY(particle_var::l_max) = lmax1;
505 GET_PROPERTY_FROM(idx2, buffer_arr, particle_var::a_p) = gen2;
506 GET_PROPERTY_FROM(idx2, buffer_arr, particle_var::l_max) = lmax2;
507
508 random_pool.free_state(gen);
509 }
510
511} // namespace Models
512
513#endif
Status
Definition alias.hpp:125
gen_pool_type< Kokkos::DefaultExecutionSpace > pool_type
Definition alias.hpp:100
KernelConcentrationType LocalConcentration
Definition alias.hpp:173
Kokkos::View< F *[Nc], ComputeSpace::array_layout, ComputeSpace, Kokkos::MemoryTraits< Kokkos::MemoryTraitsFlags::Restrict > > ParticlesContribs
Definition alias.hpp:66
Kokkos::View< F *[Nd], ComputeSpace::array_layout, ComputeSpace, Kokkos::MemoryTraits< Kokkos::MemoryTraitsFlags::Restrict > > ParticlesModel
Definition alias.hpp:52
Compile time elemental closure of the reactions of Models::Acetate.
Definition acetate.hpp:32
constexpr double e_surplus(double m_cmol_sub, double gamma_sub, double y_x)
Definition acetate.hpp:47
constexpr double gamma_biomass
4 + 1.8 - 1.0 - 0.6
Definition acetate.hpp:41
constexpr double m_o2
[g/mol]
Definition acetate.hpp:33
constexpr double y_o2_ox(double m_cmol_sub, double gamma_sub, double y_x)
Definition acetate.hpp:56
constexpr double m_cmol_biomass
CH1.8O0.5N0.2 [g/Cmol].
Definition acetate.hpp:36
constexpr double m_cmol_glucose
C6H12O6, 180/6 [g/Cmol].
Definition acetate.hpp:34
constexpr double m_cmol_acetate
C2H4O2, 60/2 [g/Cmol].
Definition acetate.hpp:35
constexpr double y_ac_fer(double m_cmol_sub, double gamma_sub, double y_x)
sub -> X + Ac + CO2 (+H2O) : gAc per g of substrate
Definition acetate.hpp:63
constexpr double gamma_acetate
(2*4 + 4 - 2*2)/2
Definition acetate.hpp:40
constexpr double gamma_glucose
Degree of reduction per C-mole.
Definition acetate.hpp:39
Models definition.
Definition acetate.hpp:18
KOKKOS_INLINE_FUNCTION MC::Status check_div(const T l, const T lc)
Definition utils.hpp:64
KOKKOS_INLINE_FUNCTION consteval F c_linear_density(F rho, F d)
Definition utils.hpp:94
Represents a LogNormal (Gaussian) probability distribution.
Definition prng_extension.hpp:525
Represents a TruncatedNormal (Gaussian) probability distribution.
Definition prng_extension.hpp:354
Acetate model with explicit oxygen limitation.
Definition acetate.hpp:91
Acetate Self
Definition acetate.hpp:93
species_index
Species indices, O2 has to stay at index 1 (gas/liquid transfer)
Definition acetate.hpp:135
@ O2
Definition acetate.hpp:137
@ Ac
Definition acetate.hpp:138
@ S
Definition acetate.hpp:136
@ N_N
Definition acetate.hpp:139
MODEL_CONSTANT FloatType k_s
Monod affinity constants [kg/m^3].
Definition acetate.hpp:163
MODEL_CONSTANT FloatType phi_s_max
Definition acetate.hpp:221
MODEL_CONSTANT FloatType f_pos
One explicit step removes at most 1/f_pos of the local concentration.
Definition acetate.hpp:228
MODEL_CONSTANT auto l_dist
Definition acetate.hpp:247
std::nullopt_t Config
Definition acetate.hpp:95
MODEL_CONSTANT FloatType x_c_max
Definition acetate.hpp:226
MODEL_CONSTANT FloatType y_x_go
gX/gS
Definition acetate.hpp:170
MODEL_CONSTANT FloatType d_t_floor
Only there so that d_t = 0 does not divide by zero.
Definition acetate.hpp:230
MODEL_CONSTANT FloatType l_max_m
Definition acetate.hpp:156
MC::ParticlesContribs< Self::n_c, Self::FloatType > SelfContribs
Definition acetate.hpp:124
static std::array< std::string_view, Self::n_var > names()
Definition acetate.hpp:287
MODEL_CONSTANT FloatType a_p_min
Definition acetate.hpp:235
MODEL_CONSTANT FloatType k_a
Definition acetate.hpp:166
MODEL_CONSTANT FloatType f_o2_max
Definition acetate.hpp:217
MC::ParticlesModel< Self::n_var, Self::FloatType > SelfParticle
Definition acetate.hpp:119
static std::array< std::string_view, Self::n_c > species()
Definition acetate.hpp:296
MODEL_CONSTANT FloatType y_x_ov
overflow does not grow
Definition acetate.hpp:172
MODEL_CONSTANT FloatType l_min_m
Definition acetate.hpp:157
MODEL_CONSTANT FloatType f_ac_max
Acetate uptake capacity relative to the glucose one.
Definition acetate.hpp:219
MODEL_CONSTANT FloatType k_o
Anane et. al 2017 (Biochem. Eng. J).
Definition acetate.hpp:165
Kokkos::Array< FloatType, N_N > uptake_rates
Definition acetate.hpp:153
MODEL_CONSTANT FloatType y_o2_ao
gO2/gAc
Definition acetate.hpp:181
MODEL_CONSTANT FloatType y_x_fe
gX/gS
Definition acetate.hpp:171
reaction_index
Reaction indices.
Definition acetate.hpp:144
@ N_R
Definition acetate.hpp:149
@ i_fe
Definition acetate.hpp:146
@ i_go
Definition acetate.hpp:145
@ i_ov
Definition acetate.hpp:147
@ i_ao
Definition acetate.hpp:148
static constexpr std::size_t n_var
Definition acetate.hpp:116
static KOKKOS_INLINE_FUNCTION MC::Status update(const MC::pool_type &random_pool, FloatType d_t, std::size_t idx, const SelfParticle &arr, const SelfContribs &arr_contribs, std::size_t position_index, const MC::LocalConcentration &c)
Definition acetate.hpp:381
MODEL_CONSTANT FloatType a_max_m
Definition acetate.hpp:155
particle_var
Definition acetate.hpp:98
@ phi_s
Definition acetate.hpp:109
@ length
Definition acetate.hpp:99
@ a_e
Definition acetate.hpp:104
@ phi_o2
Definition acetate.hpp:110
@ a_fe
Definition acetate.hpp:106
@ phi_a
Definition acetate.hpp:111
@ l_max
Definition acetate.hpp:100
@ __COUNT__
Definition acetate.hpp:112
@ a_go
Definition acetate.hpp:105
@ a_ao
Definition acetate.hpp:107
@ a_max
Definition acetate.hpp:102
@ a_p
Definition acetate.hpp:101
Kokkos::Array< FloatType, N_R > reaction_rates
Definition acetate.hpp:152
float FloatType
Definition acetate.hpp:94
MODEL_CONSTANT FloatType lin_density
Definition acetate.hpp:160
std::true_type uniform_weight
Definition acetate.hpp:92
static KOKKOS_INLINE_FUNCTION double mass(std::size_t idx, const SelfParticle &arr)
Definition acetate.hpp:281
MODEL_CONSTANT FloatType y_o2_go
gO2/gS, 0.384
Definition acetate.hpp:176
MODEL_CONSTANT FloatType a_p_recovery
Definition acetate.hpp:241
static constexpr std::size_t n_c
Liquid species: glucose, dioxygen, acetate.
Definition acetate.hpp:122
MODEL_CONSTANT auto l_max_dist
Definition acetate.hpp:244
static constexpr std::string_view name
Definition acetate.hpp:118
MODEL_CONSTANT FloatType d_m
Definition acetate.hpp:158
static KOKKOS_INLINE_FUNCTION void init(const MC::pool_type &random_pool, std::size_t idx, const SelfParticle &arr)
Definition acetate.hpp:305
static KOKKOS_INLINE_FUNCTION void division(const MC::pool_type &random_pool, std::size_t idx, std::size_t idx2, const SelfParticle &arr, const SelfParticle &buffer_arr)
Definition acetate.hpp:448
static KOKKOS_INLINE_FUNCTION reaction_rates metabolism(const uptake_rates &phi, FloatType nu_p, FloatType &nu)
Distribute the available uptake fluxes over the four reactions.
Definition acetate.hpp:333
MODEL_CONSTANT FloatType y_ac_fe
gAc/gS produced by fermentation, 0.808
Definition acetate.hpp:187
MODEL_CONSTANT FloatType y_ac_ov
gAc/gS produced by overflow. C6H12O6 -> 3 C2H4O2 balances as is, so 1
Definition acetate.hpp:192
MODEL_CONSTANT FloatType y_x_ao
gX/gAc
Definition acetate.hpp:173