BioCMAMC-ST
Models::Acetate Struct Reference

Acetate model with explicit oxygen limitation. More...

#include <acetate.hpp>

Public Types

enum class  particle_var : int {
  length = 0 , l_max , a_p , a_max ,
  a_e , a_go , a_fe , a_ao ,
  phi_s , phi_o2 , phi_a , __COUNT__
}
enum  species_index : std::size_t { S = 0 , O2 = 1 , Ac = 2 , N_N = n_c }
 Species indices, O2 has to stay at index 1 (gas/liquid transfer) More...
enum  reaction_index : std::size_t {
  i_go = 0 , i_fe = 1 , i_ov = 2 , i_ao = 3 ,
  N_R = 4
}
 Reaction indices. More...
using uniform_weight = std::true_type
using Self = Acetate
using FloatType = float
using Config = std::nullopt_t
using SelfParticle = MC::ParticlesModel<Self::n_var, Self::FloatType>
using SelfContribs = MC::ParticlesContribs<Self::n_c, Self::FloatType>
using reaction_rates = Kokkos::Array<FloatType, N_R>
using uptake_rates = Kokkos::Array<FloatType, N_N>

Static Public Member Functions

static KOKKOS_INLINE_FUNCTION void init (const MC::pool_type &random_pool, std::size_t idx, const SelfParticle &arr)
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)
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)
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.
static KOKKOS_INLINE_FUNCTION double mass (std::size_t idx, const SelfParticle &arr)
static std::array< std::string_view, Self::n_varnames ()
static std::array< std::string_view, Self::n_cspecies ()

Public Attributes

MODEL_CONSTANT FloatType a_max_m = 2e-6 / 3600.
MODEL_CONSTANT FloatType l_max_m = 2e-6
MODEL_CONSTANT FloatType l_min_m = l_max_m / 2.
MODEL_CONSTANT FloatType d_m = 0.6e-6
MODEL_CONSTANT FloatType lin_density = c_linear_density(static_cast<FloatType>(1000), d_m)
MODEL_CONSTANT FloatType k_s = 1e-3
 Monod affinity constants [kg/m^3].
MODEL_CONSTANT FloatType k_o = 1e-5
MODEL_CONSTANT FloatType k_a = 1e-4
MODEL_CONSTANT FloatType y_x_go = 0.5F
 gX/gS
MODEL_CONSTANT FloatType y_x_fe = 0.15F
 gX/gS
MODEL_CONSTANT FloatType y_x_ov = 0.0F
 overflow does not grow
MODEL_CONSTANT FloatType y_x_ao = 0.33F
 gX/gAc
MODEL_CONSTANT FloatType y_o2_go
 gO2/gS, 0.384
MODEL_CONSTANT FloatType y_o2_ao
 gO2/gAc
MODEL_CONSTANT FloatType y_ac_fe
 gAc/gS produced by fermentation, 0.808
MODEL_CONSTANT FloatType y_ac_ov
 gAc/gS produced by overflow. C6H12O6 -> 3 C2H4O2 balances as is, so 1
MODEL_CONSTANT FloatType f_o2_max = 1.2
MODEL_CONSTANT FloatType f_ac_max = 1. / 3.
 Acetate uptake capacity relative to the glucose one.
MODEL_CONSTANT FloatType phi_s_max = a_max_m * lin_density / y_x_go
MODEL_CONSTANT FloatType x_c_max = 30.
MODEL_CONSTANT FloatType f_pos = 2.
 One explicit step removes at most 1/f_pos of the local concentration.
MODEL_CONSTANT FloatType d_t_floor = 1e-30
 Only there so that d_t = 0 does not divide by zero.
MODEL_CONSTANT FloatType a_p_min = 1e-3F * a_max_m
MODEL_CONSTANT FloatType a_p_recovery = 0.25F
MODEL_CONSTANT auto l_max_dist
MODEL_CONSTANT auto l_dist

Static Public Attributes

static constexpr std::size_t n_var = INDEX_FROM_ENUM(particle_var::__COUNT__)
static constexpr std::string_view name = "acetate"
static constexpr std::size_t n_c = 3
 Liquid species: glucose, dioxygen, acetate.

Detailed Description

Acetate model with explicit oxygen limitation.

Derived from Models::SimpleAcetate, this model adds dissolved oxygen as a third liquid species.

Warning
The transfer kernel hardcodes the oxygen row of the kla matrix to index 1, so the species ordering (S, O2, Ac) must not be changed.

Four lumped reactions, by decreasing priority:

  • i_go S + O2 -> X + CO2 respiration
  • i_ao Ac + O2 -> X + CO2 acetate re-uptake
  • i_ov S -> Ac overflow, no growth
  • i_fe S -> X + Ac + CO2 fermentation

Mass balance

Acetate moves according to the two limitations of the cell and to nothing else:

  • a_p. The glucose that oxygen could have supported but that the growth capacity cannot handle leaves as acetate through i_ov. This is the classic overflow, active even at oxygen saturation.
  • O2. The glucose that the growth capacity could have handled but that oxygen cannot support is fermented through i_fe, which also releases acetate.
  • Acetate is taken back up by i_ao alone, on the oxygen and on the growth capacity left over by i_go. Both residuals are zero as soon as the cell overflows or ferments, so acetate is never produced and consumed in the same step.

As in SimpleAcetate the internal currency is the elongation rate a [m/s], converted to a mass flux through the linear density.

Member Typedef Documentation

◆ Config

using Models::Acetate::Config = std::nullopt_t

◆ FloatType

◆ reaction_rates

◆ Self

◆ SelfContribs

◆ SelfParticle

◆ uniform_weight

using Models::Acetate::uniform_weight = std::true_type

◆ uptake_rates

using Models::Acetate::uptake_rates = Kokkos::Array<FloatType, N_N>

Member Enumeration Documentation

◆ particle_var

enum class Models::Acetate::particle_var : int
strong
Enumerator
length 
l_max 
a_p 
a_max 
a_e 
a_go 
a_fe 
a_ao 
phi_s 
phi_o2 
phi_a 
__COUNT__ 

◆ reaction_index

enum Models::Acetate::reaction_index : std::size_t

Reaction indices.

Enumerator
i_go 
i_fe 
i_ov 
i_ao 
N_R 

◆ species_index

enum Models::Acetate::species_index : std::size_t

Species indices, O2 has to stay at index 1 (gas/liquid transfer)

Note
Plain enumerators, not MODEL_CONSTANT: they are used as runtime subscripts of Kokkos::Array in the device kernels and nvcc rejects a static constexpr scalar there ("undefined in device code"). An enumerator has no storage, so it is always usable on the device.
Enumerator
O2 
Ac 
N_N 

Member Function Documentation

◆ division()

KOKKOS_INLINE_FUNCTION void Models::Acetate::division ( const MC::pool_type & random_pool,
std::size_t idx,
std::size_t idx2,
const SelfParticle & arr,
const SelfParticle & buffer_arr )
static

◆ init()

KOKKOS_INLINE_FUNCTION void Models::Acetate::init ( const MC::pool_type & random_pool,
std::size_t idx,
const SelfParticle & arr )
static

◆ mass()

KOKKOS_INLINE_FUNCTION double Models::Acetate::mass ( std::size_t idx,
const SelfParticle & arr )
inlinestatic

◆ metabolism()

KOKKOS_INLINE_FUNCTION Acetate::reaction_rates Models::Acetate::metabolism ( const uptake_rates & phi,
FloatType nu_p,
FloatType & nu )
static

Distribute the available uptake fluxes over the four reactions.

Parameters
phiuptake potentials [kg/s] indexed by species
nu_ppotential growth rate of the cell [kgX/s]
nuout: growth rate effectively realised [kgX/s]
Returns
the reaction fluxes [kg of substrate/s]
Here is the caller graph for this function:

◆ names()

std::array< std::string_view, Self::n_var > Models::Acetate::names ( )
inlinestatic

◆ species()

std::array< std::string_view, Self::n_c > Models::Acetate::species ( )
inlinestatic

◆ update()

KOKKOS_INLINE_FUNCTION MC::Status Models::Acetate::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 )
static
Here is the call graph for this function:

Member Data Documentation

◆ a_max_m

MODEL_CONSTANT FloatType Models::Acetate::a_max_m = 2e-6 / 3600.

◆ a_p_min

MODEL_CONSTANT FloatType Models::Acetate::a_p_min = 1e-3F * a_max_m

Lowest admissible growth capacity [m/s]. a_p has to stay strictly positive: it is the only thing that lets a starved lineage grow again, and log(a_p) is taken at every division.

◆ a_p_recovery

MODEL_CONSTANT FloatType Models::Acetate::a_p_recovery = 0.25F

Regression of the newborn capacity toward its own a_max at division. a_e <= a_p holds by construction, so a redistribution centred on the performance of the mother alone (0) is a one way ratchet: the capacity of a lineage can only decrease and collapses to 0 over the generations.

◆ d_m

MODEL_CONSTANT FloatType Models::Acetate::d_m = 0.6e-6

◆ d_t_floor

MODEL_CONSTANT FloatType Models::Acetate::d_t_floor = 1e-30

Only there so that d_t = 0 does not divide by zero.

◆ f_ac_max

MODEL_CONSTANT FloatType Models::Acetate::f_ac_max = 1. / 3.

Acetate uptake capacity relative to the glucose one.

◆ f_o2_max

MODEL_CONSTANT FloatType Models::Acetate::f_o2_max = 1.2

Oxygen uptake capacity, as a multiple of the stoichiometric demand of a fully respired glucose uptake. Above 1 the cell is never limited by its own uptake machinery, only by the dissolved oxygen available.

Note
the fermentation onset does not depend on y_o2_go: the respirable glucose is min(phi_S, f_o2_max * phi_s_max * monod(O2)), the yield cancels between the capacity and the phi[O2]/y_o2_go bound.

◆ f_pos

MODEL_CONSTANT FloatType Models::Acetate::f_pos = 2.

One explicit step removes at most 1/f_pos of the local concentration.

◆ k_a

MODEL_CONSTANT FloatType Models::Acetate::k_a = 1e-4

◆ k_o

MODEL_CONSTANT FloatType Models::Acetate::k_o = 1e-5

Anane et. al 2017 (Biochem. Eng. J). The sharp switch this gives is what the uptake cap of positivity makes affordable explicitly.

◆ k_s

MODEL_CONSTANT FloatType Models::Acetate::k_s = 1e-3

Monod affinity constants [kg/m^3].

◆ l_dist

MODEL_CONSTANT auto Models::Acetate::l_dist
Initial value:
l_max_m * 0.75, l_max_m / 10., 0.7 * l_min_m, l_max_m * 1.3)
Represents a TruncatedNormal (Gaussian) probability distribution.
Definition prng_extension.hpp:354
MODEL_CONSTANT FloatType l_max_m
Definition acetate.hpp:174
MODEL_CONSTANT FloatType l_min_m
Definition acetate.hpp:175

◆ l_max_dist

MODEL_CONSTANT auto Models::Acetate::l_max_dist

◆ l_max_m

MODEL_CONSTANT FloatType Models::Acetate::l_max_m = 2e-6

◆ l_min_m

MODEL_CONSTANT FloatType Models::Acetate::l_min_m = l_max_m / 2.

◆ lin_density

MODEL_CONSTANT FloatType Models::Acetate::lin_density = c_linear_density(static_cast<FloatType>(1000), d_m)

◆ n_c

std::size_t Models::Acetate::n_c = 3
staticconstexpr

Liquid species: glucose, dioxygen, acetate.

◆ n_var

std::size_t Models::Acetate::n_var = INDEX_FROM_ENUM(particle_var::__COUNT__)
staticconstexpr

◆ name

std::string_view Models::Acetate::name = "acetate"
staticconstexpr

◆ phi_s_max

MODEL_CONSTANT FloatType Models::Acetate::phi_s_max = a_max_m * lin_density / y_x_go

◆ x_c_max

MODEL_CONSTANT FloatType Models::Acetate::x_c_max = 30.

Highest biomass concentration the reactor is expected to reach [kg/m^3]. Sizes the cap below, no influence on the metabolism; overestimating it only makes the cap engage a little earlier.

◆ y_ac_fe

MODEL_CONSTANT FloatType Models::Acetate::y_ac_fe
Initial value:
= static_cast<FloatType>(
constexpr double m_cmol_glucose
C6H12O6, 180/6 [g/Cmol].
Definition acetate.hpp:34
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_glucose
Degree of reduction per C-mole.
Definition acetate.hpp:39
MODEL_CONSTANT FloatType y_x_fe
gX/gS
Definition acetate.hpp:190
float FloatType
Definition acetate.hpp:113

gAc/gS produced by fermentation, 0.808

◆ y_ac_ov

MODEL_CONSTANT FloatType Models::Acetate::y_ac_ov
Initial value:
= static_cast<FloatType>(
MODEL_CONSTANT FloatType y_x_ov
overflow does not grow
Definition acetate.hpp:191

gAc/gS produced by overflow. C6H12O6 -> 3 C2H4O2 balances as is, so 1

◆ y_o2_ao

MODEL_CONSTANT FloatType Models::Acetate::y_o2_ao
Initial value:
= static_cast<FloatType>(
constexpr double y_o2_ox(double m_cmol_sub, double gamma_sub, double y_x)
Definition acetate.hpp:56
constexpr double m_cmol_acetate
C2H4O2, 60/2 [g/Cmol].
Definition acetate.hpp:35
constexpr double gamma_acetate
(2*4 + 4 - 2*2)/2
Definition acetate.hpp:40
MODEL_CONSTANT FloatType y_x_ao
gX/gAc
Definition acetate.hpp:192

gO2/gAc

◆ y_o2_go

MODEL_CONSTANT FloatType Models::Acetate::y_o2_go
Initial value:
= static_cast<FloatType>(
MODEL_CONSTANT FloatType y_x_go
gX/gS
Definition acetate.hpp:189

gO2/gS, 0.384

◆ y_x_ao

MODEL_CONSTANT FloatType Models::Acetate::y_x_ao = 0.33F

gX/gAc

◆ y_x_fe

MODEL_CONSTANT FloatType Models::Acetate::y_x_fe = 0.15F

gX/gS

◆ y_x_go

MODEL_CONSTANT FloatType Models::Acetate::y_x_go = 0.5F

gX/gS

◆ y_x_ov

MODEL_CONSTANT FloatType Models::Acetate::y_x_ov = 0.0F

overflow does not grow


The documentation for this struct was generated from the following file: