API

About

PlantHydraulics.jl provides numerical hydraulic models that can be used to simulate the flow and pressure profiles in plants. In the model, hydraulic system is a combination of hydraulic organs, which are Root, Stem, and Leaf. And as a result, the functions to simulate flow and pressure profiles can be used at organ level and system level. For example, for the simplest case, one can simulate the pressure profile within a xylem segment; and for the most complex case, one can simulate the flow and pressure profiles in a tree with multiple roots, trunk, multiple canopy layers (a stem and a leaf per layer).

Although PlantHydraulics.jl is meant to server as a fundamental dependency package of the CliMA Land, it can also be used as a standalone package and thus to use with other vegetation modeling other than CliMA Land. Below, we will show some examples of how to use PlantHydraulics.jl at organ and plant level.

Organ Level Simulations

Root, Stem, and Leaf organs differ in the following:

  • Root has a rhizosphere component before the xylem
  • Leaf has an extraxylary component after the xylem
  • Stem and Root have a height change to account for gravity
  • Stem and Root capacitance is along the flow path
  • Leaf capacitance is at the end of the flow path (along with extraxylary component)

For example in a Leaf, to simulate the flow and pressure profiles, what you need to do are

using ClimaCache
using PlantHydraulics
FT = Float64;

leaf = ClimaCache.Leaf{FT}();
stem = ClimaCache.Stem{FT}();
root = ClimaCache.Root{FT}();
soil = ClimaCache.SoilLayer{FT}();
PlantHydraulics.xylem_flow_profile!(leaf, FT(1));
PlantHydraulics.xylem_flow_profile!(stem, FT(1));
PlantHydraulics.xylem_flow_profile!(root, FT(1));
PlantHydraulics.xylem_pressure_profile!(leaf);
PlantHydraulics.xylem_pressure_profile!(stem);
PlantHydraulics.xylem_pressure_profile!(root, soil);

Note the second parameter FT(1) is the time step in second to use with non-steady state mode. If the flow mode is steady state, FT(1) will not be used; otherwise, water source/sink term will be applied based on the state of the capacitance tissue. As there is a rhizosphere component in the Root, which uses soil moisture retension curve to compute soil water potential, we need to pass soil information to the xylem_pressure_profile! function when updating soil pressure profile.

Plant Level Simulation

While one can always customize the hydraulic system using functions xylem_flow_profile! and xylem_pressure_profile!, we provide shortcut functions to soil-plant-air continuum where soil layers, plant, and air layers are aligned. For example, a spac of a tree (MonoMLTreeSPAC).

spac = ClimaCache.MonoMLTreeSPAC{FT}();
PlantHydraulics.xylem_flow_profile!(spac, FT(1));
PlantHydraulics.xylem_pressure_profile!(spac);

Similarly, one can use MonoMLGrassSPAC, MonoMLPalmSPAC, and MonoElementSPAC (Mono means mono species spac, ML means multiple root and canopy layers, Grass with no trunk and branch, Palm with no branch, and Element means the spac consists of one soil layer, root, stem, and leaf element each). Currently, the predefined SPAC only supports the four listed above. If you need more customized SPACs, you will need to combine the fundamental functions xylem_flow_profile! and xylem_pressure_profile! appropriately. Be carefuly to not forget to synchronize the flow rates with stomtal conductance (this is done automactically for predefined SPACs).

Vulnerability curve

SoilHydraulics.relative_hydraulic_conductanceMethod
relative_hydraulic_conductance(vc::ComplexVC{FT}, p_25::FT) where {FT<:AbstractFloat}
relative_hydraulic_conductance(vc::LogisticVC{FT}, p_25::FT) where {FT<:AbstractFloat}

Return the hydraulic conductance ralative to maximum at reference temperature, given

  • vc ComplexVC, LogisticVC, PowerVC, or WeibullVC type vulnerability curve
  • p_25 Equivalent xylem water pressure at 298.15 K in [MPa] (surface tension correction made)
source
PlantHydraulics.critical_pressureFunction
critical_pressure(vc::ComplexVC{FT}, kr::FT = FT(0.001)) where {FT<:AbstractFloat}
critical_pressure(vc::LogisticVC{FT}, kr::FT = FT(0.001)) where {FT<:AbstractFloat}
critical_pressure(vc::PowerVC{FT}, kr::FT = FT(0.001)) where {FT<:AbstractFloat}
critical_pressure(vc::WeibullVC{FT}, kr::FT = FT(0.001)) where {FT<:AbstractFloat}

Return the critical xylem water pressure at 25 °C that triggers a given amount of loss of conductance, given

  • vc ComplexVC, LogisticVC, PowerVC, or WeibullVC type struct
  • kr Reference conductance, default is 0.001
source

Pressure volume curve

PlantHydraulics.xylem_pressureFunction
xylem_pressure(pv::LinearPVCurve{FT}, rvol::FT, T::FT) where {FT<:AbstractFloat}
xylem_pressure(pv::SegmentedPVCurve{FT}, rvol::FT, T::FT) where {FT<:AbstractFloat}

Return the xylem water pressure in MPa, given

  • pv LinearPVCurve or SegmentedPVCurve type pressure volume curve
  • rvol Relative volume (relative to maximum)
  • T Temperature
source
PlantHydraulics.capacitance_bufferFunction
capacitance_buffer(pvc::LinearPVCurve{FT}) where {FT<:AbstractFloat}
capacitance_buffer(pvc::SegmentedPVCurve{FT}) where {FT<:AbstractFloat}

Return the relative capacictance buffer rate, given

  • pv LinearPVCurve or SegmentedPVCurve type pressure volume curve
source

Cavitation legacy

PlantHydraulics.clear_legacy!Function
clear_legacy!(spac::MonoElementSPAC{FT}) where {FT<:AbstractFloat}
clear_legacy!(spac::MonoMLGrassSPAC{FT}) where {FT<:AbstractFloat}
clear_legacy!(spac::MonoMLPalmSPAC{FT}) where {FT<:AbstractFloat}
clear_legacy!(spac::MonoMLTreeSPAC{FT}) where {FT<:AbstractFloat}
clear_legacy!(organ::Union{Leaf{FT}, Leaves2D{FT}, Root{FT}, Stem{FT}}) where {FT<:AbstractFloat}
clear_legacy!(organ::Leaves1D{FT}) where {FT<:AbstractFloat}

Clear the legacy for hydraulic organ or system, given

  • spac MonoElementSPAC, MonoMLGrassSPAC, MonoMLPalmSPAC, or MonoMLTreeSPAC type structure
  • organ Leaf, Leaves1D, Leaves2D, Root, or Stem type structure
source

FLow profile

PlantHydraulics.flow_inFunction
flow_in(organ::Union{Leaf{FT}, Leaves2D{FT}, Root{FT}, Stem{FT}}) where {FT<:AbstractFloat}
flow_in(organ::Leaves1D{FT}) where {FT<:AbstractFloat}
flow_in(organs::Vector{Leaves2D{FT}}) where {FT<:AbstractFloat}
flow_in(organs::Vector{Stem{FT}}) where {FT<:AbstractFloat}

Return the flow rate, given

  • organ Leaf, Leaves1D, Leaves2D, Root, or Stem type struct
  • organs Vector of Leaves2D or Stem type struct
source
PlantHydraulics.flow_outFunction
flow_out(lf::Union{Leaf{FT}, Leaves2D{FT}}) where {FT<:AbstractFloat}

Return the net flow that escape from the leaf, given

  • lf Leaf, Leaves2D, Root, or Stem type organ
source
PlantHydraulics.root_pkFunction
root_pk(root::Root{FT}) where {FT<:AbstractFloat}

Return the root end pressure and total hydraulic conductance to find solution of flow rates in all roots, given

  • root Root type struct
source
PlantHydraulics.xylem_flow_profile!Function

This function is designed to serve the following functionalities:

  • Update flow profile in different organs
  • Partition root flow rates at different layers
  • Update flow profile for entire SPAC
source
PlantHydraulics.xylem_flow_profile!Method
xylem_flow_profile!(organ::Union{Leaf{FT}, Leaves2D{FT}, Root{FT}, Stem{FT}}, Δt::FT) where {FT<:AbstractFloat}
xylem_flow_profile!(organ::Leaves1D{FT}, Δt::FT) where {FT<:AbstractFloat}

Update organ flow rate profile after setting up the flow rate out, given

  • organ Leaf, Leaves1D, Leaves2D, Root, or Stem type struct
  • Δt Time step length
source
PlantHydraulics.xylem_flow_profile!Method
xylem_flow_profile!(spac::MonoElementSPAC{FT}, Δt::FT) where {FT<:AbstractFloat}
xylem_flow_profile!(spac::MonoMLGrassSPAC{FT}, Δt::FT) where {FT<:AbstractFloat}
xylem_flow_profile!(spac::MonoMLPalmSPAC{FT}, Δt::FT) where {FT<:AbstractFloat}
xylem_flow_profile!(spac::MonoMLTreeSPAC{FT}, Δt::FT) where {FT<:AbstractFloat}

Update flow profiles for the soil-plant-air continuum (set up leaf flow rate from stomatal conductance first), given

  • spac MonoElementSPAC, MonoMLGrassSPAC, MonoMLPalmSPAC, or MonoMLTreeSPAC type SPAC system
  • Δt Time step length
source

Pressure profile

PlantHydraulics.xylem_end_pressureFunction
xylem_end_pressure(organ::Union{Leaf{FT}, Stem{FT}}, flow::FT) where {FT<:AbstractFloat}
xylem_end_pressure(organ::Root{FT}, slayer::SoilLayer{FT}, flow::FT) where {FT<:AbstractFloat}
xylem_end_pressure(spac::MonoElementSPAC{FT}, flow::FT) where {FT<:AbstractFloat}

Return the xylem end water pressure in MPa, given

  • organ Leaf, Root, or Stem type struct
  • slayer Soil layer corresponded to root
  • flow Flow rate (per leaf area for Leaf) [mol (m⁻²) s⁻¹]
  • spac MonoElementSPAC type struct
source
PlantHydraulics.xylem_pressure_profile!Method
xylem_pressure_profile!(spac::MonoElementSPAC{FT}; update::Bool = true) where {FT<:AbstractFloat}
xylem_pressure_profile!(spac::MonoMLGrassSPAC{FT}; update::Bool = true) where {FT<:AbstractFloat}
xylem_pressure_profile!(spac::MonoMLPalmSPAC{FT}; update::Bool = true) where {FT<:AbstractFloat}
xylem_pressure_profile!(spac::MonoMLTreeSPAC{FT}; update::Bool = true) where {FT<:AbstractFloat}

Update xylem pressure profile (flow profile needs to be updated a priori), given

  • spac MonoElementSPAC, MonoMLGrassSPAC, MonoMLPalmSPAC, or MonoMLTreeSPAC type spac
  • update If true, update xylem cavitation legacy
source
PlantHydraulics.∂E∂PFunction
∂E∂P(lf::Union{Leaf{FT}, Leaves2D{FT}}, flow::FT; δe::FT = FT(1e-7)) where {FT<:AbstractFloat}
∂E∂P(lf::Leaves1D{FT}, flow::FT, ind::Int; δe::FT = FT(1e-7)) where {FT<:AbstractFloat}

Return the marginal hydraulic conductance, given

  • lf Leaf, Leaves1D, or Leaves2D type struct
  • flow Flow rate through the leaf xylem [mol m⁻² s⁻¹]
  • δe Incremental flow rate, default is 1e-7
  • ind Which leaf in Leaves1D (1 for sunlit and 2 for shaded)
source

Critical flow

PlantHydraulics.critical_flowFunction

This function returns the critical flow rate that triggers a given amount of loss of hydraulic conductance for

  • Leaf hydraulic system
  • Mono element SPAC system
source
PlantHydraulics.critical_flowMethod
critical_flow(hs::LeafHydraulics{FT}, T::FT, ini::FT = FT(0.5); kr::FT = FT(0.001)) where {FT<:AbstractFloat}

Return the critical flow rate that triggers a given amount of loss of conductance, given

  • hs LeafHydraulics type struct
  • T Liquid temperature
  • ini Initial guess
  • kr Reference conductance, default is 0.001
source
PlantHydraulics.critical_flowMethod
critical_flow(spac::MonoElementSPAC{FT}, ini::FT = FT(0.5); kr::FT = FT(0.001)) where {FT<:AbstractFloat}

Return the critical flow rate that triggers a given amount of loss of conductance, given

  • spac MonoElementSPAC type struct
  • ini Initial guess
  • kr Reference conductance, default is 0.001
source

Tuning factor

PlantHydraulics.β_factorFunction
β_factor(f::Function, vc::AbstractXylemVC{FT}, x_25::FT) where {FT<:AbstractFloat}
β_factor(f::Function, vc::AbstractSoilVC{FT}, x_25::FT) where {FT<:AbstractFloat}
β_factor(f::Function, x_25::FT) where {FT<:AbstractFloat}

Return the β factor based on relative conductance or soil potential/pressure, given

  • f Function to translate relative k to β, for example f(x) = x, f(x) = x², and f(x) = sqrt(x) for x in [0,1]
  • vc Leaf vulnerability curve or soil vulnerability curve (moisture retention curve)
  • x_25 Leaf xylem pressure corrected to 25 °C, soil water potential corrected to 25 °C (forcing on roots, note that this function may not be useful for plants with salt stress), or soil water content
source
PlantHydraulics.β_factor!Function

This function updates the beta factor for SPAC if empirical models are used. The method is meant to support all SPAC defined in ClimaCache.jl:

  • MonoElementSPAC
  • MonoMLGrassSPAC
  • MonoMLPalmSPAC
  • MonoMLTreeSPAC
source
PlantHydraulics.β_factor!Method
β_factor!(spac::MonoElementSPAC{FT}) where {FT<:AbstractFloat}

Update the beta factor for the LEAF component in SPAC, given

  • spac MonoElementSPAC type SPAC
source
PlantHydraulics.β_factor!Method
β_factor!(spac::Union{MonoMLGrassSPAC{FT}, MonoMLPalmSPAC{FT}, MonoMLTreeSPAC{FT}}) where {FT<:AbstractFloat}

Update the β factor for the LEAVES component in SPAC, given

  • spac MonoMLGrassSPAC, MonoMLPalmSPAC, or MonoMLTreeSPAC type SPAC

Note that if the β function is based on Kleaf or Pleaf, β factor is taken as that of leaf; if the β function is based on Ksoil, Psoil, or Θ, β is taken as the average weighted by flow rate in each root.

source

Energy budget

PlantHydraulics.plant_energy!Function

This function has two major functionalities:

  • Compute marginal energy increase in each organ
  • Update the temperature in each organ when time step provided
source
PlantHydraulics.plant_energy!Method
plant_energy!(spac::MonoMLGrassSPAC{FT}) where {FT<:AbstractFloat}
plant_energy!(spac::MonoMLPalmSPAC{FT}) where {FT<:AbstractFloat}
plant_energy!(spac::MonoMLTreeSPAC{FT}) where {FT<:AbstractFloat}

Compute the marginal energy increase in spac, given

  • spac MonoMLGrassSPAC, MonoMLPalmSPAC, or MonoMLTreeSPAC type SPAC
source
PlantHydraulics.plant_energy!Method
plant_energy!(spac::MonoMLGrassSPAC{FT}, δt::FT) where {FT<:AbstractFloat}
plant_energy!(spac::MonoMLPalmSPAC{FT}, δt::FT) where {FT<:AbstractFloat}
plant_energy!(spac::MonoMLTreeSPAC{FT}, δt::FT) where {FT<:AbstractFloat}

Compute the marginal energy increase in spac, given

  • spac MonoMLGrassSPAC, MonoMLPalmSPAC, or MonoMLTreeSPAC type SPAC
  • δt Time step
source