conductance#
- openalea.hydroroot.conductance.axial(acol=[], scale=1)[source]#
the purpose is to give in arguments a set of 2 lists representing a x-y data and to return it with y*scale
- Parameters:
acol – list (Default value = [])
scale – float (Default value = 1)
- Returns:
x, y (list) - 2 lists
- openalea.hydroroot.conductance.compute_K(g, scale_factor=1.0)[source]#
Compute the conductance in dimension \([L^3 P^{-1} T^{-1}]\) from the ‘experimental’ one which is in \([L^4 P^{-1} T^{-1}]\)
In each vertex compute \(K = K_{exp} \frac{\text{scale_factor}}{\text{vertex_length}}\)
- Parameters:
g – (MTG) - the root architecture
scale_factor – (float) - a factor used for sensitivity analysis (Default value = 1)
- Returns:
g (MTG) - with the property K set
- openalea.hydroroot.conductance.compute_k(g, k0=300.0)[source]#
Compute the radial conductance k (\(10^{-9}\ m^4.s^{-1}.MPa^{-1}\)) of each vertex of the MTG.
\[\begin{split}k = 2 \\pi r l k0\end{split}\]with l and r the segment length and radius of the vertex
if k0 == “k0”: calculation using k0 values from g.property(‘k0’) on each vertex
if k0 is a float: use this value in the calculation
- Parameters:
g – (MTG)
k0 – (float or string) - “k0” or the radial conductivity in \(10^{-9}\\ m.s^{-1}.MPa^{-1}\) (Default value = 300.)
- openalea.hydroroot.conductance.fit_property_from_spline(g, spline, prop_in, prop_out)[source]#
compute a property from another one using a spline transformation.
Retrieve the values from the prop_in of the MTG. And evaluate the spline according to prop_in to compute the property prop_out
- Parameters:
g – MTG
spline – (class scipy)
prop_in – (string)
prop_out – (string)
- Example:
Typically, we have, as input, the axial conductance versus distance to tip K(x) given as a list of 2 lists of few number of floats. Then we have to calculate on each vertex the axial conductance according to it. To do that, we first fit with a spline K(x) and then use the present function to use the spline to compute K according to the position of the vertex.
- openalea.hydroroot.conductance.poiseuille(radius, length, viscosity=0.001)[source]#
Compute a conductance of a cylindrical element based on its radius and length.
- Parameters:
radius – (float)
length – (float)
viscosity – (float) (Default value = 1e-3)
The Poiseuille formula is, for a cylinder \(K = {\pi r^4} / {8 \mu l}\)
with \(r\) the radius of a pipe, \(\mu\) the viscosity of the liquid, \(l\) the length of the pipe.
- openalea.hydroroot.conductance.radial(v=92, acol=[], scale=1)[source]#
create a list of uniform value v*scale of the same length than acol the purpose is to return x-y data in a form of two lists
- Parameters:
v – (float) (Default value = 92)
acol – (list) 2 lists of floats (Default value = [])
scale – (float) (Default value = 1)
- Returns:
xr, yr (list)
- Example:
in HydroRoot the conductivity and the conductance are properties versus distance to tip. Then if in the yaml file with parameters we give a float for k0, we must transform it to a list of 2 lists of float as the axial conductance.
- openalea.hydroroot.conductance.radial_step(kmin=92, factor=1.0, x_step=None, x_base=1.0, dx=0.0001, scale=1.0)[source]#
Radial conductivity k as a step function.
k is set to its maximum value (kmin * factor) from the tip (x=0) to x_step, and its minimum value kmin from x_step + dx to x_base.
- Parameters:
kmin – Float (Default value = 92)
factor – Float (Default value = 1.0)
x_step – Float (Default value = None)
x_base – Float (Default value = 1.)
dx – Float (Default value = 1.0e-4)
scale – Float (Default value = 1.0)
- Returns:
xr: (list), list of distance from the tip
yr: (list), list of radial k values
- openalea.hydroroot.conductance.set_conductances(g, axial_pr, k0_pr, axial_lr=None, k0_lr=None)[source]#
Set the MTG properties ‘K_exp’, ‘K’ and ‘k’:
K_exp: the model input axial conductance in \([L^4.P^{-1}.T^{-1}]\)
K: the effective axial conductance of each vertex \(K=K_{exp}/l\ [L^3.P^{-1}.T^{-1}]\)
k: the radial conductance \(k=2 \pi r l k_0 \ [L^3.P^{-1}.T^{-1}]\)
with r and l the radius and the length of the vertex respectively.
if axial_lr is None, set ‘K_exp’ and ‘K’ according to axial_pr whatever the roots order, otherwise set the roots of order == 0 according to axial_pr and others according to axial_lr. idem for the radial conductivity if k0_lr is not None.
- Parameters:
g – (MTG)
axial_pr – (list) - axial conductance (\(10^{-9}\ m^4.MPa^{-1}.s^{-1}\)) vs distance to tip, 2 lists of float
k0_pr – (float) - radial donductivity (\(10^{-9}\ m.MPa^{-1}.s^{-1}\))
axial_lr – (list) - axial conductance (\(10^{-9}\ m^4.MPa^{-1}.s^{-1}\)) for root of order > 0, 2 lists of float (Default value = None)
k0_lr – (float) - radial donductivity (\(10^{-9}\ m.MPa^{-1}.s^{-1}\)) for root of order > 0 (Default value = None)
- Returns:
g (MTG)
- openalea.hydroroot.conductance.setting_k0_according_to_order(g, k0_pr, k0_lr)[source]#
Set uniform radial conductivity to roots according to their order:
to k0_pr for the primary root (order == 0),
to k0_lr otherwise
- Parameters:
g – (MTG)
k0_pr – (float) - radial donductivity (\(10^{-9}\ m.MPa^{-1}.s^{-1}\)) for the primary root
k0_lr – (float) - radial donductivity (\(10^{-9}\ m.MPa^{-1}.s^{-1}\)) for root of order > 0
- Returns:
g: (MTG) - the root architecture with k0_pr and k0_lr set
Download the source file ../../src/openalea/hydroroot/conductance.py.