endoR_devel: endoR_devel - the development version of the endotherm model...

View source: R/endoR_devel.R

endoR_develR Documentation

endoR_devel - the development version of the endotherm model of NicheMapR

Description

This model uses R code to implement postural and physiological thermoregulation under a given environmental scenario for an organism of a specified shape and no extra body parts. In this function the sequence of thermoregulatory events in the face of heat stress is to first change posture (uncurl), second change flesh conductivity, third raise core temperature, fourth pant and fifth sweat. This can be modified to be more specific to the species of interest, e.g. by changing the sequence of responses or having some happen in parallel. endoR implements the endoR_devel sequence of thermoregulation within FORTRAN and is up to 10x faster. Thus you can use endoR_Devel as a basis for prototyping and refining and then adjust the FORTRAN code of endoR (SOLVENDO.f) accordingly and compile your own version.

Usage

endoR_devel(AMASS = 65, SHAPE = 4, SHAPE_B = 1.1, FURTHRMK = 0, ZFURD = 2E-03, ZFURV = 2E-03, TC = 37, TC_MAX = 39, TA = 20, TGRD = TA, TSKY = TA, VEL = 0.1, RH = 5, QSOLR = 0, Z = 20, SHADE = 0,...)

Arguments

TA

= 20, air temperature at local height (°C)

TGRD

= TA, ground temperature (°C)

TSKY

= TA, sky temperature (°C)

VEL

= 0.1, wind speed (m/s)

RH

= 5, relative humidity (%)

QSOLR

= 0, solar radiation, horizontal plane (W/m2)

Z

= 20, zenith angle of sun (degrees from overhead)

SHADE

= 0, shade level (%)

AMASS

= 65, # kg

SHAPE

= 4, # shape, 1 is cylinder, 2 is sphere, 3 is plate, 4 is ellipsoid

SHAPE_B

= 1.1, # current ratio between long and short axis (-)

FURTHRMK

= 0, # user-specified fur thermal conductivity (W/mK), not used if 0

ZFURD

= 2E-03, # fur depth, dorsal (m)

ZFURV

= 2E-03, # fur depth, ventral (m)

TC

= 37, # core temperature (°C)

TC_MAX

= 39, # maximum core temperature (°C)

Details

Parameters controlling how the model runs:

DIFTOL = 0.001, error tolerance for SIMULSOL (°C)

THERMOREG = 1, thermoregulate? (1 = yes, 0 = no)

RESPIRE = 1, respiration? (1 = yes, 0 = no)

Environment:

TAREF = TA, air temperature at reference height (°C)

ELEV = 0, elevation (m)

ABSSB = 0.8, solar absorptivity of substrate (fractional, 0-1)

FLTYPE = 0, fluid type: 0 = air; 1 = fresh water; 2 = salt water

TCONDSB = TGRD, surface temperature for conduction (°C)

KSUB = 2.79, substrate thermal conductivity (W/m°C)
TBUSH = TA, bush temperature (°C)

BP = -1, Pa, negatve means elevation is used

O2GAS = 20.95, oxygen concentration of air, to account for non-atmospheric concentrations e.g. in burrows (%)

N2GAS = 79.02, nitrogen concetration of air, to account for non-atmospheric concentrations e.g. in burrows (%)

CO2GAS = 0.0412, carbon dioxide concentration of air, to account for non-atmospheric concentrations e.g. in burrows (%)

R_PCO2 = CO2GAS / 100, reference atmospheric dioxide concentration (proportion) of air, to allow for anthropogenic change (%)

PDIF = 0.15, proportion of solar radiation that is diffuse (fractional, 0-1)

Behaviour:

SHADE = 0, shade level (%)

FLYHR = 0, is flight occuring this hour? (imposes forced evaporative loss)

UNCURL = 0.1, allows the animal to uncurl to SHAPE_B_MAX, the value being the increment SHAPE_B is increased per iteration

TC_INC = 0.1, turns on core temperature elevation, the value being the increment by which TC is increased per iteration

PCTWET_INC = 0.1, turns on sweating, the value being the increment by which PCTWET is increased per iteration (%)

PCTWET_MAX = 100, maximum surface area that can be wet (%)

AK1_INC = 0.1, turns on thermal conductivity increase (W/mK), the value being the increment by which AK1 is increased per iteration (W/m°C)

AK1_MAX = 2.8, maximum flesh conductivity (W/mK)

PANT = 1, multiplier on breathing rate to simulate panting (-)

PANT_INC = 0.1, increment for multiplier on breathing rate to simulate panting (-)

PANT_MULT = 1.05, multiplier on basal metabolic rate at maximum panting level (-)

PANT_MAX = 10, # maximum breathing rate multiplier to simulate panting (-)

General morphology:

ANDENS = 1000, body density (kg/m3)

SUBQFAT = 0, is subcutaneous fat present? (0 is no, 1 is yes)

FATPCT = 20, % body fat

SHAPE_B_MAX = 5, max possible ratio between long and short axis (-)

SHAPE_C = SHAPE_B, current ratio of length:height (plate)

PVEN = 0.5, fraction of surface area that is ventral fur (fractional, 0-1)

PCOND = 0, fraction of surface area that is touching the substrate (fractional, 0-1)

SAMODE = 0, if 0, uses surface area for SHAPE geometry, if 1, uses bird skin surface area allometry from Walsberg & King. 1978. JEB 76:185–189, if 2 uses mammal surface area from Stahl 1967.J. App. Physiol. 22, 453–460.

ORIENT = 0, if 1 = normal to rays of sun (heat maximising), if 2 = parallel to rays of sun (heat minimising), 3 = vertical and changing with solar altitude, or 0 = average of parallel and perpendicular

Fur properties:

DHAIRD = 30E-06, hair diameter, dorsal (m)

DHAIRV = 30E-06, hair diameter, ventral (m)

LHAIRD = 23.9E-03, hair length, dorsal (m)

LHAIRV = 23.9E-03, hair length, ventral (m)

RHOD = 3000E+04, hair density, dorsal (1/m2)

RHOV = 3000E+04, hair density, ventral (1/m2)

REFLD = 0.2, fur reflectivity dorsal (fractional, 0-1)

REFLV = 0.2, fur reflectivity ventral (fractional, 0-1)

ZFURCOMP = ZFURV, depth of compressed fur (for conduction) (m)

KHAIR = 0.209, hair thermal conductivity (W/m°C)

XR = 1, fractional depth of fur at which longwave radiation is exchanged (0-1)

Radiation exchange:

EMISAN = 0.99, animal emissivity (-)

FABUSH = 0, this is for veg below/around animal (at TALOC)

FGDREF = 0.5, reference configuration factor to ground

FSKREF = 0.5, configuration factor to sky

Physiology:

AK1 = 0.9, # initial thermal conductivity of flesh (0.412 - 2.8 W/mK)

AK2 = 0.230, # conductivity of fat (W/mK)

QBASAL = (70 * AMASS ^ 0.75) * (4.185 / (24 * 3.6)), # basal heat generation (W) based on Kleiber 1947

PCTWET = 0.5, # part of the skin surface that is wet (%)

FURWET = 0, # Area of fur/feathers that is wet after rain (%)

PCTBAREVAP = 0, surface area for evaporation that is skin, e.g. licking paws (%)

PCTEYES = 0, # surface area made up by the eye (%) - make zero if sleeping

DELTAR = 0, # offset between air temperature and breath (°C)

RELXIT = 100, # relative humidity of exhaled air, %

RQ = 0.80, # respiratory quotient (fractional, 0-1)

EXTREF = 20, # O2 extraction efficiency (%)

Q10 = 2, # Q10 factor for adjusting BMR for TC

Initial conditions:

TS = TC - 3, # initial skin temperature (°C)

TFA = TA, # initial fur/air interface temperature (°C)

Outputs:

treg variables (thermoregulatory response):

  • 1 TC - core temperature (°C)

  • 2 TLUNG - lung temperature (°C)

  • 3 TSKIN_D - dorsal skin temperature (°C)

  • 4 TSKIN_V - ventral skin temperature (°C)

  • 5 TFA_D - dorsal fur-air interface temperature (°C)

  • 6 TFA_V - ventral fur-air interface temperature (°C)

  • 7 SHAPE_B - current ratio between long and short axis due to postural change (-)

  • 8 PANT - breathing rate multiplier (-)

  • 9 SKINWET - part of the skin surface that is wet (%)

  • 10 K_FLESH - thermal conductivity of flesh (W/m°C)

  • 11 K_FUR - thermal conductivity of fur (W/m°C)

  • 12 K_FUR_D - thermal conductivity of dorsal fur (W/m°C)

  • 13 K_FUR_V - thermal conductivity of ventral fur (W/m°C)

  • 14 K_COMPFUR - thermal conductivity of compressed fur (W/m°C)

  • 15 Q10 - Q10 multiplier on metabolic rate (-)

morph variables (morphological traits):

  • 1 AREA - total outer surface area (m2)

  • 2 VOLUME - total volume (m3)

  • 3 CHAR_DIM - characteristic dimension for convection (m)

  • 4 MASS_FAT - fat mass (kg)

  • 5 FAT_THICK - thickness of fat layer (m)

  • 6 FLESH_VOL - flesh volume (m3)

  • 7 LENGTH - length (m)

  • 8 WIDTH - width (m)

  • 9 HEIGHT - height (m)

  • 10 DIAM_FLESH - diameter, core to skin (m)

  • 11 DIAM_FUR - diameter, core to fur (m)

  • 12 AREA_SIL - silhouette area (m2)

  • 13 AREA_SILN - silhouette area normal to sun's rays (m2)

  • 14 AREA_ASILP - silhouette area parallel to sun's rays (m2)

  • 15 AREA_SKIN - total skin area (m2)

  • 16 AREA_SKIN_EVAP - skin area available for evaporation (m2)

  • 17 AREA_CONV - area for convection (m2)

  • 18 AREA_COND - area for conduction (m2)

  • 19 F_SKY - configuration factor to sky (-)

  • 20 F_GROUND - configuration factor to ground (-)

enbal variables (energy balance):

  • 1 QSOL - solar radiation absorbed (W)

  • 2 QIRIN - longwave (infra-red) radiation absorbed (W)

  • 3 QGEN - metabolic heat production (W)

  • 4 QEVAP - evaporation (W)

  • 5 QIROUT - longwave (infra-red) radiation lost (W)

  • 6 QCONV - convection (W)

  • 7 QCOND - conduction (W)

  • 8 ENB - energy balance (W)

  • 9 NTRY - iterations required for a solution (-)

  • 10 SUCCESS - was a solution found (0=no, 1=yes)

masbal variables (mass exchanges):

  • 1 AIR_L - breathing rate (L/h)

  • 2 O2_L - oxygen consumption rate (L/h)

  • 3 H2OResp_g - respiratory water loss (g/h)

  • 4 H2OCut_g - cutaneous water loss (g/h)

  • 5 O2_mol_in - oxygen inhaled (mol/h)

  • 6 O2_mol_out - oxygen expelled (mol/h)

  • 7 N2_mol_in - nitrogen inhaled (mol/h)

  • 8 N2_mol_out - nitrogen expelled (mol/h)

  • 9 AIR_mol_in - air inhaled (mol/h)

  • 10 AIR_mol_out - air expelled (mol/h)

Examples

library(NicheMapR)
# environment
TAs <- seq(0, 50, 2) # air temperatures (deg C)
VEL <- 0.01 # wind speed (m/s)
RH <- 10 # relative humidity (%)
QSOLR <- 100 # solar radiation (W/m2)

# core temperature
TC <- 38 # core temperature (deg C)
TC_MAX <- 43 # maximum core temperature (deg C)
TC_INC <- 0.25 # increment by which TC is elevated (deg C)

# size and shape
AMASS <- 0.0337 # mass (kg)
SHAPE_B <- 1.1 # start off near to a sphere (-)
SHAPE_B_MAX <- 5 # maximum ratio of length to width/depth

# fur/feather properties
DHAIRD = 30E-06 # hair diameter, dorsal (m)
DHAIRV = 30E-06 # hair diameter, ventral (m)
LHAIRD = 23.1E-03 # hair length, dorsal (m)
LHAIRV = 22.7E-03 # hair length, ventral (m)
ZFURD = 5.8E-03 # fur depth, dorsal (m)
ZFURV = 5.6E-03 # fur depth, ventral (m)
RHOD = 8000E+04 # hair density, dorsal (1/m2)
RHOV = 8000E+04 # hair density, ventral (1/m2)
REFLD = 0.248  # fur reflectivity dorsal (fractional, 0-1)
REFLV = 0.351  # fur reflectivity ventral (fractional, 0-1)

# physiological responses
PCTWET <- 0.1 # base skin wetness (%)
PCTWET_MAX <- 20 # maximum skin wetness (%)
PCTWET_INC <- 0.25 # intervals by which skin wetness is increased (%)
Q10 <- 2 # Q10 effect of body temperature on metabolic rate
QBASAL <- 10 ^ (-1.461 + 0.669 * log10(AMASS * 1000)) # basal heat generation (W) (bird formula from McKechnie and Wolf 2004 Phys. & Biochem. Zool. 77:502-521)
DELTAR <- 5 # offset between air temperature and breath (deg C)
EXTREF <- 15 # O2 extraction efficiency (%)
PANT_INC <- 0.1 # turns on panting, the value being the increment by which the panting multiplier is increased up to the maximum value, PANT_MAX
PANT_MAX <- 3 # maximum panting rate - multiplier on air flow through the lungs above that determined by metabolic rate

ptm <- proc.time() # start timing
endo.out <- lapply(1:length(TAs), function(x){endoR_devel(TA = TAs[x], QSOLR = QSOLR, VEL = VEL, TC = TC, TC_MAX = TC_MAX, RH = RH, AMASS = AMASS, SHAPE_B = SHAPE_B, SHAPE_B_MAX = SHAPE_B_MAX, PCTWET = PCTWET, PCTWET_INC = PCTWET_INC, PCTWET_MAX = PCTWET_MAX, Q10 = Q10, QBASAL = QBASAL, DELTAR = DELTAR, DHAIRD = DHAIRD, DHAIRV = DHAIRV, LHAIRD = LHAIRD, LHAIRV = LHAIRV, ZFURD = ZFURD, ZFURV = ZFURV, RHOD = RHOD, RHOV = RHOV, REFLD = REFLD, TC_INC = TC_INC, PANT_INC = PANT_INC, PANT_MAX = PANT_MAX, EXTREF = EXTREF)}) # run endoR across environments
proc.time() - ptm # stop timing

endo.out1 <- do.call("rbind", lapply(endo.out, data.frame)) # turn results into data frame
treg <- endo.out1[, grep(pattern = "treg", colnames(endo.out1))]
colnames(treg) <- gsub(colnames(treg), pattern = "treg.", replacement = "")
morph <- endo.out1[, grep(pattern = "morph", colnames(endo.out1))]
colnames(morph) <- gsub(colnames(morph), pattern = "morph.", replacement = "")
enbal <- endo.out1[, grep(pattern = "enbal", colnames(endo.out1))]
colnames(enbal) <- gsub(colnames(enbal), pattern = "enbal.", replacement = "")
masbal <- endo.out1[, grep(pattern = "masbal", colnames(endo.out1))]
colnames(masbal) <- gsub(colnames(masbal), pattern = "masbal.", replacement = "")

QGEN <- enbal$QGEN # metabolic rate (W)
H2O <- masbal$H2OResp_g + masbal$H2OCut_g # g/h water evaporated
TFA_D <- treg$TFA_D # dorsal fur surface temperature
TFA_V <- treg$TFA_V # ventral fur surface temperature
TskinD <- treg$TSKIN_D # dorsal skin temperature
TskinV <- treg$TSKIN_V # ventral skin temperature
TCs <- treg$TC # core temperature

par(mfrow = c(2, 2))
par(oma = c(2, 1, 2, 2) + 0.1)
par(mar = c(3, 3, 1.5, 1) + 0.1)
par(mgp = c(2, 1, 0))
plot(QGEN ~ TAs, type = 'l', ylab = 'metabolic rate, W', xlab = 'air temperature, deg C', ylim = c(0.2, 1.2))
plot(H2O ~ TAs, type = 'l', ylab = 'water loss, g/h', xlab = 'air temperature, deg C', ylim = c(0, 1.5))
points(masbal$H2OResp_g ~ TAs, type = 'l', lty = 2)
points(masbal$H2OCut_g ~ TAs, type = 'l', lty = 2, col = 'blue')
legend(x = 3, y = 1.5, legend = c("total", "respiratory", "cutaneous"), col = c("black", "black", "blue"), lty = c(1, 2, 2), bty = "n")
plot(TFA_D ~ TAs, type = 'l', col = 'grey', ylab = 'temperature, deg C', xlab = 'air temperature, deg C', ylim = c(10, 50))
points(TFA_V ~ TAs, type = 'l', col = 'grey', lty = 2)
points(TskinD ~ TAs, type = 'l', col = 'orange')
points(TskinV ~ TAs, type = 'l', col = 'orange', lty = 2)
points(TCs ~ TAs, type = 'l', col = 'red')
legend(x = 30, y = 33, legend = c("core", "skin dorsal", "skin ventral", "feathers dorsal", "feathers ventral"), col = c("red", "orange", "orange", "grey", "grey"), lty = c(1, 1, 2, 1, 2), bty = "n")
plot(masbal$AIR_L * 1000 / 60 ~ TAs, ylim=c(0,250),  lty = 1, xlim=c(-5,50), ylab = "ml / min", xlab=paste("air temperature (deg C)"), type = 'l')

mrke/NicheMapR documentation built on April 3, 2024, 10:05 a.m.