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
109 struct Acetate
110 {
111 using uniform_weight = std::true_type;
112 using Self = Acetate;
113 using FloatType = float;
114 using Config = std::nullopt_t;
115
116 enum class particle_var : int // NOLINT
117 {
122 // Export
127 // Contributions
132 };
133
134 static constexpr std::size_t n_var
135 = INDEX_FROM_ENUM(particle_var::__COUNT__);
136
137 static constexpr std::string_view name = "acetate";
139
141 static constexpr std::size_t n_c = 3;
142
144
152 enum species_index : std::size_t
153 {
154 S = 0,
155 O2 = 1,
156 Ac = 2,
158 };
159
161 enum reaction_index : std::size_t
162 {
163 i_go = 0, // glucose oxidation
164 i_fe = 1, // glucose fermentation
165 i_ov = 2, // acetate overflow
166 i_ao = 3, // acetate oxidation
167 N_R = 4
168 };
169
170 using reaction_rates = Kokkos::Array<FloatType, N_R>;
171 using uptake_rates = Kokkos::Array<FloatType, N_N>;
172
173 MODEL_CONSTANT FloatType a_max_m = 2e-6 / 3600.; // m/s
174 MODEL_CONSTANT FloatType l_max_m = 2e-6; // m
175 MODEL_CONSTANT FloatType l_min_m = l_max_m / 2.; // m
176 MODEL_CONSTANT FloatType d_m = 0.6e-6; // m
177 MODEL_CONSTANT FloatType lin_density
178 = c_linear_density(static_cast<FloatType>(1000), d_m); // kg/m
179
181 MODEL_CONSTANT FloatType k_s = 1e-3;
184 MODEL_CONSTANT FloatType k_o = 1e-5;
185 MODEL_CONSTANT FloatType k_a = 1e-4;
186
187 // Stoichiometry, growth yields
188
189 MODEL_CONSTANT FloatType y_x_go = 0.5F;
190 MODEL_CONSTANT FloatType y_x_fe = 0.15F;
191 MODEL_CONSTANT FloatType y_x_ov = 0.0F;
192 MODEL_CONSTANT FloatType y_x_ao = 0.33F;
193
195 MODEL_CONSTANT FloatType y_o2_go = static_cast<FloatType>(
198 y_x_go));
200 MODEL_CONSTANT FloatType y_o2_ao = static_cast<FloatType>(
203 y_x_ao));
204
206 MODEL_CONSTANT FloatType y_ac_fe = static_cast<FloatType>(
209 y_x_fe));
211 MODEL_CONSTANT FloatType y_ac_ov = static_cast<FloatType>(
214 y_x_ov));
215
216 // A reaction cannot need a negative amount of O2 or acetate, nor build
217 // more carbon than its substrate carries.
218 static_assert(y_o2_go > 0.F
221 "i_go: y_x too high, negative O2 or CO2");
222 static_assert(y_o2_ao > 0.F
225 "i_ao: y_x too high, negative O2 or CO2");
226 static_assert(y_ac_fe > 0.F && y_ac_fe < y_ac_ov,
227 "i_fe: y_x too high, cannot grow and excrete as much acetate "
228 "as the pure overflow");
229
236 MODEL_CONSTANT FloatType f_o2_max = 1.2;
238 MODEL_CONSTANT FloatType f_ac_max = 1. / 3.;
239
240 MODEL_CONSTANT FloatType phi_s_max = a_max_m * lin_density / y_x_go; // kg/s
241
245 MODEL_CONSTANT FloatType x_c_max = 30.;
247 MODEL_CONSTANT FloatType f_pos = 2.;
249 MODEL_CONSTANT FloatType d_t_floor = 1e-30;
250
254 MODEL_CONSTANT FloatType a_p_min = 1e-3F * a_max_m;
255
260 MODEL_CONSTANT FloatType a_p_recovery = 0.25F;
261
262 MODEL_CONSTANT auto l_max_dist
264 l_max_m, l_max_m / 10., l_max_m * 0.7, 1.3 * l_max_m);
265
267 l_max_m * 0.75, l_max_m / 10., 0.7 * l_min_m, l_max_m * 1.3);
268
269 KOKKOS_INLINE_FUNCTION static void init(const MC::pool_type& random_pool,
270 std::size_t idx,
271 const SelfParticle& arr);
272
273 KOKKOS_INLINE_FUNCTION static MC::Status
274 update([[maybe_unused]] const MC::pool_type& random_pool,
275 FloatType d_t,
276 std::size_t idx,
277 const SelfParticle& arr,
278 const SelfContribs& arr_contribs,
279 std::size_t position_index,
280 const MC::LocalConcentration& c);
281
282 KOKKOS_INLINE_FUNCTION static void
283 division(const MC::pool_type& random_pool,
284 std::size_t idx,
285 std::size_t idx2,
286 const SelfParticle& arr,
287 const SelfParticle& buffer_arr);
288
296 KOKKOS_INLINE_FUNCTION static reaction_rates
297 metabolism(const uptake_rates& phi, FloatType nu_p, FloatType& nu);
298
299 KOKKOS_INLINE_FUNCTION static double
300 mass(std::size_t idx, const SelfParticle& arr)
301 {
302 return GET_PROPERTY(Self::particle_var::length) * lin_density;
303 }
304
305 static std::array<std::string_view, Self::n_var>
307 {
308 return {
309 "length", "l_max", "a_p", "a_max", "a_e", "a_go",
310 "a_fe", "a_ao", "phi_s", "phi_o2", "phi_a",
311 };
312 }
313
314 static std::array<std::string_view, Self::n_c>
316 {
317 return { "glucose", "O2", "acetate" };
318 }
319 };
320
321 CHECK_MODEL(Acetate)
322
323 KOKKOS_INLINE_FUNCTION void
324 Acetate::init([[maybe_unused]] const MC::pool_type& random_pool,
325 std::size_t idx,
326 const SelfParticle& arr)
327 {
328
329 MODEL_CONSTANT auto a_max_dist
331 a_max_m, a_max_m / 2., 0.5 * a_max_m, a_max_m * 1.5);
332
333 static constexpr auto ld = l_dist;
334 static constexpr auto lm = l_dist;
335 auto gen = random_pool.get_state();
336 GET_PROPERTY(particle_var::length) = ld.draw(gen);
337 GET_PROPERTY(particle_var::l_max) = l_max_m;
338 GET_PROPERTY(particle_var::a_p) = a_max_m / 2.;
339 GET_PROPERTY(particle_var::a_max) = a_max_dist.mean();
340 random_pool.free_state(gen);
341
342 GET_PROPERTY(particle_var::a_e) = 0.;
343 GET_PROPERTY(particle_var::a_go) = 0.;
344 GET_PROPERTY(particle_var::a_fe) = 0.;
345 GET_PROPERTY(particle_var::a_ao) = 0.;
346 GET_PROPERTY(particle_var::phi_s) = 0.;
347 GET_PROPERTY(particle_var::phi_o2) = 0.;
348 GET_PROPERTY(particle_var::phi_a) = 0.;
349 }
350
351 KOKKOS_INLINE_FUNCTION Acetate::reaction_rates
353 const FloatType nu_p,
354 FloatType& nu)
355 {
356 constexpr auto zero = static_cast<FloatType>(0);
357 reaction_rates r = {}; // zero initialised
358
359 // i_go: respiration, highest priority. Bounded by the glucose, by the
360 // oxygen and by the
361 // growth capacity.
362 const FloatType s_ox_max = Kokkos::min(phi[S], phi[O2] / y_o2_go); // kgS/s
363 r[i_go] = Kokkos::min(s_ox_max, nu_p / y_x_go);
364 nu = r[i_go] * y_x_go;
365
366 // i_ov: overflow. Glucose that oxygen could have supported but that the
367 // growth capacity cannot handle, excreted as acetate. a_p driven branch.
368 r[i_ov] = Kokkos::max(s_ox_max - r[i_go], zero);
369
370 // i_ao: acetate re-uptake, on the oxygen and on the growth capacity left
371 // over by i_go. so
372 // acetate is never produced and consumed at the same time.
373 const FloatType o2_res = Kokkos::max(phi[O2] - (r[i_go] * y_o2_go), zero);
374 r[i_ao] = Kokkos::min(Kokkos::min(phi[Ac], o2_res / y_o2_ao),
375 Kokkos::max(nu_p - nu, zero) / y_x_ao);
376 nu += r[i_ao] * y_x_ao;
377
378 // i_fe: fermentation, lowest priority.
379 const FloatType s_res = Kokkos::max(phi[S] - r[i_go] - r[i_ov], zero);
380 r[i_fe] = Kokkos::min(s_res, Kokkos::max(nu_p - nu, zero) / y_x_fe);
381 nu += r[i_fe] * y_x_fe;
382
383 KOKKOS_ASSERT(r[i_go] >= zero);
384 KOKKOS_ASSERT(r[i_fe] >= zero);
385 KOKKOS_ASSERT(r[i_ov] >= zero);
386 KOKKOS_ASSERT(r[i_ao] >= zero);
387 KOKKOS_ASSERT(nu >= zero && nu <= nu_p * static_cast<FloatType>(1.001));
388 // No reaction may draw more than the uptake made available: this is what
389 // carries the uptake cap over to the liquid contributions
390 KOKKOS_ASSERT(r[i_go] + r[i_fe] + r[i_ov]
391 <= phi[S] * static_cast<FloatType>(1.001));
392 KOKKOS_ASSERT((r[i_go] * y_o2_go) + (r[i_ao] * y_o2_ao)
393 <= phi[O2] * static_cast<FloatType>(1.001));
394 KOKKOS_ASSERT(r[i_ao] <= phi[Ac] * static_cast<FloatType>(1.001));
395
396 return r;
397 }
398
399 KOKKOS_INLINE_FUNCTION MC::Status
400 Acetate::update([[maybe_unused]] const MC::pool_type& random_pool,
401 FloatType d_t,
402 std::size_t idx,
403 const SelfParticle& arr,
404 const SelfContribs& arr_contribs,
405 const std::size_t position_index,
406 const MC::LocalConcentration& c)
407 {
408 const auto c_s = GET_CLAMPED_CONCENTRATION_CAST(FloatType, S);
409 const auto c_o2 = GET_CLAMPED_CONCENTRATION_CAST(FloatType, O2);
410 const auto c_ac = GET_CLAMPED_CONCENTRATION_CAST(FloatType, Ac);
411
412 const FloatType phi_s_max_p
413 = GET_PROPERTY(particle_var::a_max) * lin_density / y_x_go;
414 const FloatType phi_o2_max_p = f_o2_max * y_o2_go * phi_s_max_p;
415 const FloatType phi_ac_max_p = f_ac_max * phi_s_max_p;
416
417 // Largest uptake one cell may take from the compartment during this step
418 // without the explicit liquid update going negative
419 const FloatType share = (GET_PROPERTY(particle_var::length) * lin_density)
420 / ((f_pos * x_c_max * d_t) + d_t_floor);
421
422 // Monod uptake potentials [kg/s].
423 uptake_rates phi{};
424 phi[S] = phi_s_max_p * c_s / (c_s + k_s);
425 phi[O2] = Kokkos::min(phi_o2_max_p * c_o2 / (c_o2 + k_o), share * c_o2);
426 phi[Ac] = Kokkos::min(phi_ac_max_p * c_ac / (c_ac + k_a), share * c_ac);
427
428 // Growth capacity of the individual, inherited at division and kept in
429 // ]0, a_max] by division()
430 const FloatType nu_p = GET_PROPERTY(particle_var::a_p) * lin_density;
431
432 FloatType nu = 0.F;
433 const reaction_rates r = metabolism(phi, nu_p, nu);
434
435 const FloatType inv_lin_density = static_cast<FloatType>(1) / lin_density;
436 const FloatType a_e = nu * inv_lin_density;
437
438 GET_PROPERTY(particle_var::a_e) = a_e;
439 GET_PROPERTY(particle_var::a_go) = r[i_go] * y_x_go * inv_lin_density;
440 GET_PROPERTY(particle_var::a_fe) = r[i_fe] * y_x_fe * inv_lin_density;
441 GET_PROPERTY(particle_var::a_ao) = r[i_ao] * y_x_ao * inv_lin_density;
442
443 GET_PROPERTY(particle_var::length) += d_t * a_e;
444
445 // Glucose: consumed by respiration, fermentation and overflow
446 const FloatType phi_s = -(r[i_go] + r[i_fe] + r[i_ov]);
447 // Oxygen: only consumed, it is fed to the liquid by the gas/liquid transfer
448 const FloatType phi_o2 = -((r[i_go] * y_o2_go) + (r[i_ao] * y_o2_ao));
449 // Acetate: produced by fermentation (O2 limited) and by overflow (a_p
450 // limited), consumed by acetate oxidation
451 const FloatType phi_a
452 = ((r[i_fe] * y_ac_fe) + (r[i_ov] * y_ac_ov)) - r[i_ao];
453
454 GET_PROPERTY(particle_var::phi_s) = phi_s;
455 GET_PROPERTY(particle_var::phi_o2) = phi_o2;
456 GET_PROPERTY(particle_var::phi_a) = phi_a;
457
458 GET_CONTRIBS(S) = phi_s;
459 GET_CONTRIBS(O2) = phi_o2;
460 GET_CONTRIBS(Ac) = phi_a;
461
462 return check_div(GET_PROPERTY(Self::particle_var::length),
463 GET_PROPERTY(Self::particle_var::l_max));
464 }
465
466 KOKKOS_INLINE_FUNCTION void
467 Acetate::division([[maybe_unused]] const MC::pool_type& random_pool,
468 std::size_t idx,
469 std::size_t idx2,
470 const SelfParticle& arr,
471 const SelfParticle& buffer_arr)
472 {
473 Kokkos::View<FloatType**,
474 ComputeSpace::array_layout,
475 Kokkos::MemoryTraits<Kokkos::MemoryTraitsFlags::Restrict>>
476 buffer_e = buffer_arr;
477
478 const FloatType current_l = GET_PROPERTY(particle_var::length);
479 const FloatType new_current_length = current_l / 2.F;
480 GET_PROPERTY(particle_var::length) = new_current_length;
481 constexpr auto binf = INDEX_FROM_ENUM(particle_var::length);
482 constexpr auto bsup = INDEX_FROM_ENUM(particle_var::a_e);
483 for (auto i = binf; i < bsup; ++i)
484 {
485 COPY_PROPERTY_TO(i, idx2, buffer_e);
486 }
487
488 // Local copies: nvcc rejects a static constexpr member passed by reference
489 // to Kokkos::min/max/clamp ("undefined in device code")
490 const FloatType ap_min = a_p_min;
491 const FloatType a_max_i
492 = Kokkos::max(GET_PROPERTY(particle_var::a_max), ap_min);
493
494 // Effective elongation of the mother, floored: a fully starved cell would
495 // otherwise give log(0)
496 const FloatType a_e_i
497 = Kokkos::clamp(GET_PROPERTY(particle_var::a_e), ap_min, a_max_i);
498
499 // Centre of the redistribution. a_e <= a_p always holds, so centring on
500 // a_e alone makes the capacity of a lineage a decreasing sequence that
501 // converges to 0; the pull toward a_max keeps a_p away from 0 and lets a
502 // starved lineage recover when the environment improves.
503 const FloatType a_target = a_e_i + (a_p_recovery * (a_max_i - a_e_i));
504
505 auto gen = random_pool.get_state();
506 const double sigma = 0.2;
507 const double average
508 = Kokkos::log(static_cast<double>(a_target)) - sigma * sigma / 2;
509 const auto dist = MC::Distributions::LogNormal<double>(average, sigma);
510
511 // Clamped to [a_p_min, a_max]: a null capacity freezes the sub-lineage for
512 // the rest of the run
513 const auto gen1 = Kokkos::clamp(
514 static_cast<FloatType>(dist.draw(gen)), ap_min, a_max_i);
515 const auto gen2 = Kokkos::clamp(
516 static_cast<FloatType>(dist.draw(gen)), ap_min, a_max_i);
517
518 static constexpr auto local_l = l_max_dist;
519 const FloatType lmax1 = local_l.draw(gen);
520 const FloatType lmax2 = local_l.draw(gen);
521
522 GET_PROPERTY(particle_var::a_p) = gen1;
523 GET_PROPERTY(particle_var::l_max) = lmax1;
524 GET_PROPERTY_FROM(idx2, buffer_arr, particle_var::a_p) = gen2;
525 GET_PROPERTY_FROM(idx2, buffer_arr, particle_var::l_max) = lmax2;
526
527 random_pool.free_state(gen);
528 }
529
530} // namespace Models
531
532#endif
Status
Definition alias.hpp:125
gen_pool_type< Kokkos::DefaultExecutionSpace > pool_type
Definition alias.hpp:100
KernelConcentrationType LocalConcentration
Definition alias.hpp:170
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:110
Acetate Self
Definition acetate.hpp:112
species_index
Species indices, O2 has to stay at index 1 (gas/liquid transfer)
Definition acetate.hpp:153
@ O2
Definition acetate.hpp:155
@ Ac
Definition acetate.hpp:156
@ S
Definition acetate.hpp:154
@ N_N
Definition acetate.hpp:157
MODEL_CONSTANT FloatType k_s
Monod affinity constants [kg/m^3].
Definition acetate.hpp:181
MODEL_CONSTANT FloatType phi_s_max
Definition acetate.hpp:240
MODEL_CONSTANT FloatType f_pos
One explicit step removes at most 1/f_pos of the local concentration.
Definition acetate.hpp:247
MODEL_CONSTANT auto l_dist
Definition acetate.hpp:266
std::nullopt_t Config
Definition acetate.hpp:114
MODEL_CONSTANT FloatType x_c_max
Definition acetate.hpp:245
MODEL_CONSTANT FloatType y_x_go
gX/gS
Definition acetate.hpp:189
MODEL_CONSTANT FloatType d_t_floor
Only there so that d_t = 0 does not divide by zero.
Definition acetate.hpp:249
MODEL_CONSTANT FloatType l_max_m
Definition acetate.hpp:174
MC::ParticlesContribs< Self::n_c, Self::FloatType > SelfContribs
Definition acetate.hpp:143
static std::array< std::string_view, Self::n_var > names()
Definition acetate.hpp:306
MODEL_CONSTANT FloatType a_p_min
Definition acetate.hpp:254
MODEL_CONSTANT FloatType k_a
Definition acetate.hpp:185
MODEL_CONSTANT FloatType f_o2_max
Definition acetate.hpp:236
MC::ParticlesModel< Self::n_var, Self::FloatType > SelfParticle
Definition acetate.hpp:138
static std::array< std::string_view, Self::n_c > species()
Definition acetate.hpp:315
MODEL_CONSTANT FloatType y_x_ov
overflow does not grow
Definition acetate.hpp:191
MODEL_CONSTANT FloatType l_min_m
Definition acetate.hpp:175
MODEL_CONSTANT FloatType f_ac_max
Acetate uptake capacity relative to the glucose one.
Definition acetate.hpp:238
MODEL_CONSTANT FloatType k_o
Definition acetate.hpp:184
Kokkos::Array< FloatType, N_N > uptake_rates
Definition acetate.hpp:171
MODEL_CONSTANT FloatType y_o2_ao
gO2/gAc
Definition acetate.hpp:200
MODEL_CONSTANT FloatType y_x_fe
gX/gS
Definition acetate.hpp:190
reaction_index
Reaction indices.
Definition acetate.hpp:162
@ N_R
Definition acetate.hpp:167
@ i_fe
Definition acetate.hpp:164
@ i_go
Definition acetate.hpp:163
@ i_ov
Definition acetate.hpp:165
@ i_ao
Definition acetate.hpp:166
static constexpr std::size_t n_var
Definition acetate.hpp:135
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:400
MODEL_CONSTANT FloatType a_max_m
Definition acetate.hpp:173
particle_var
Definition acetate.hpp:117
@ phi_s
Definition acetate.hpp:128
@ length
Definition acetate.hpp:118
@ a_e
Definition acetate.hpp:123
@ phi_o2
Definition acetate.hpp:129
@ a_fe
Definition acetate.hpp:125
@ phi_a
Definition acetate.hpp:130
@ l_max
Definition acetate.hpp:119
@ __COUNT__
Definition acetate.hpp:131
@ a_go
Definition acetate.hpp:124
@ a_ao
Definition acetate.hpp:126
@ a_max
Definition acetate.hpp:121
@ a_p
Definition acetate.hpp:120
Kokkos::Array< FloatType, N_R > reaction_rates
Definition acetate.hpp:170
float FloatType
Definition acetate.hpp:113
MODEL_CONSTANT FloatType lin_density
Definition acetate.hpp:178
std::true_type uniform_weight
Definition acetate.hpp:111
static KOKKOS_INLINE_FUNCTION double mass(std::size_t idx, const SelfParticle &arr)
Definition acetate.hpp:300
MODEL_CONSTANT FloatType y_o2_go
gO2/gS, 0.384
Definition acetate.hpp:195
MODEL_CONSTANT FloatType a_p_recovery
Definition acetate.hpp:260
static constexpr std::size_t n_c
Liquid species: glucose, dioxygen, acetate.
Definition acetate.hpp:141
MODEL_CONSTANT auto l_max_dist
Definition acetate.hpp:263
static constexpr std::string_view name
Definition acetate.hpp:137
MODEL_CONSTANT FloatType d_m
Definition acetate.hpp:176
static KOKKOS_INLINE_FUNCTION void init(const MC::pool_type &random_pool, std::size_t idx, const SelfParticle &arr)
Definition acetate.hpp:324
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:467
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:352
MODEL_CONSTANT FloatType y_ac_fe
gAc/gS produced by fermentation, 0.808
Definition acetate.hpp:206
MODEL_CONSTANT FloatType y_ac_ov
gAc/gS produced by overflow. C6H12O6 -> 3 C2H4O2 balances as is, so 1
Definition acetate.hpp:211
MODEL_CONSTANT FloatType y_x_ao
gX/gAc
Definition acetate.hpp:192