The BioCro C++ Library
leaf_gbw_campbell.h
Go to the documentation of this file.
1#ifndef LEAF_GBW_CAMPBELL_H
2#define LEAF_GBW_CAMPBELL_H
3
4#include "../framework/module.h"
5#include "../framework/state_map.h"
6#include "water_and_air_properties.h" // for saturation_vapor_pressure, molar_volume
7#include "boundary_layer_conductance.h" // for leaf_boundary_layer_conductance_campbell
8
9namespace standardBML
10{
17class leaf_gbw_campbell : public direct_module
18{
19 public:
21 state_map const& input_quantities,
22 state_map* output_quantities)
23 : direct_module{},
24
25 // Get references to input quantities
26 windspeed{get_input(input_quantities, "windspeed")},
27 leafwidth{get_input(input_quantities, "leafwidth")},
28 air_temperature{get_input(input_quantities, "temp")},
29 leaf_temperature{get_input(input_quantities, "leaf_temperature")},
30 air_pressure{get_input(input_quantities, "air_pressure")},
31
32 // Get pointers to output quantities
33 gbw_leaf_op{get_op(output_quantities, "gbw_leaf")}
34 {
35 }
36 static string_vector get_inputs();
37 static string_vector get_outputs();
38 static std::string get_name() { return "leaf_gbw_campbell"; }
39
40 private:
41 // References to input quantities
42 double const& windspeed;
43 double const& leafwidth;
44 double const& air_temperature;
45 double const& leaf_temperature;
46 double const& air_pressure;
47
48 // Pointers to output quantities
49 double* gbw_leaf_op;
50
51 // Main operation
52 void do_operation() const;
53};
54
56{
57 return {
58 "windspeed", // m / s
59 "leafwidth", // m
60 "temp", // degrees C
61 "leaf_temperature", // degrees C
62 "air_pressure" // Pa
63 };
64}
65
67{
68 return {
69 "gbw_leaf" // m / s
70 };
71}
72
73void leaf_gbw_campbell::do_operation() const
74{
75 // Calculate the boundary layer conductance. Here we need to convert
76 // stomatal conductance from mol / m^2 / s to m / s.
77 const double gbw_leaf = leaf_boundary_layer_conductance_campbell(
78 air_temperature,
79 leaf_temperature - air_temperature,
80 leafwidth,
81 windspeed,
82 air_pressure); // m / s
83
84 // Update the output quantity list
85 update(gbw_leaf_op, gbw_leaf); // m / s
86}
87
88} // namespace standardBML
89#endif
double leaf_boundary_layer_conductance_campbell(double air_temperature, double delta_t, double lw, double windspeed, double p)
Calculates the conductance for water vapor flow from the leaf across its boundary layer using a model...
Calculates the boundary layer conductance using the leaf_boundary_layer_conductance_campbell() functi...
leaf_gbw_campbell(state_map const &input_quantities, state_map *output_quantities)
static string_vector get_outputs()
static string_vector get_inputs()
This is the standard BioCro module library; it includes the essential modules used in typical BioCro ...
Definition: aba_decay.h:8