Commit a58c0c78 authored by jouke's avatar jouke
Browse files

enabling stomatalConductance in the leaf temperature calculation

parent 67086e9f
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -27,8 +27,8 @@ NOTE: The GPL.v3 license requires that all derivative work is distributed under
#include "../PlantType.hpp"
#include <math.h>

LeafTemperature::LeafTemperature(SimulaDynamic* pSD):DerivativeBase(pSD),
absorptance(0.85), IRAbsorptance(0.95), leafCharacteristicDimension(0.1), conversionFactor(1){
LeafTemperature::LeafTemperature(SimulaDynamic *pSD) :
		DerivativeBase(pSD), absorptance(0.85), IRAbsorptance(0.95), leafCharacteristicDimension(0.1), conversionFactor(1) {
	std::string name = pSD->getName().substr(0, 6); // name = sunlit or shaded
	std::string plantType;
	PLANTTYPE(plantType,pSD);
@@ -54,7 +54,8 @@ absorptance(0.85), IRAbsorptance(0.95), leafCharacteristicDimension(0.1), conver
	pTranspirationRate = pSD->existingSibling(name + "PotentialTranspirationRate", "cm3/day");
	if (!pTranspirationRate)
		pTranspiration = pSD->getSibling(name + "PotentialTranspiration", "cm3");
	pLeafArea = pSD->getSibling(name + "LeafArea");
	pLeafArea = pSD->getSibling(name + "LeafArea", "cm2");
	pStomatalConductance = pSD->getSibling(name + "StomatalConductance", "mol/m2/s");
}
void LeafTemperature::calculate(const Time &t, double &LT){
	// We adapt the leaf energy balance as described in Park S. Nobel - Physiochemical and Environmental Plant Physiology, Fourth Edition, 2009
@@ -102,8 +103,8 @@ void LeafTemperature::calculate(const Time &t, double &LT){

	//checking realistic transpirationRate
	const double RH = 0.5;
	//todo stomatalConductance_->get(t, g_sV); //mol/m2/s
	const double g_sw = 0.2; // mean total conductance to water vapor (mol/m2/s)
	double g_sw = 0.2; // mean total conductance to water vapor (mol/m2/s)
	pStomatalConductance->get(t, g_sw); //mol/m2/s
	const double P_atm = 101325; // Atmospheric pressure (Pa)
	//Saturation Vapor Pressure Function (Pa) - Tetens Equation
	auto calc_esat = [](double tempC) {return(611 * exp((17.27 * tempC) / (tempC + 237.3)));};
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ public:
protected:
	void calculate(const Time &t, double &concentration);
	double absorptance, IRAbsorptance, leafCharacteristicDimension, conversionFactor;
	SimulaBase *pIrradiation, *pAirTemperature, *pWindSpeed, *pTranspirationRate, *pTranspiration, *pLeafArea;
	SimulaBase *pIrradiation, *pAirTemperature, *pWindSpeed, *pTranspirationRate, *pTranspiration, *pLeafArea, *pStomatalConductance;
};

#endif /*LEAFTEMPERATURE_HPP_*/