Thomas: Thomas algorithm for solving simultanious heat fluxes

View source: R/code.R

ThomasR Documentation

Thomas algorithm for solving simultanious heat fluxes

Description

Thomas implements the Thomas algorithm for solving simultanious heat fluxes between soil / air layers.

Usage

Thomas(tc, tmsoil, tair, k, cd, f = 0.6, X = 0)

Arguments

tc

vector of soil and air temperatures (deg C) from previous timestep (see details)

tmsoil

temperature (deg C) of deepest soil layer. Typically mean annual temperature

tair

air temperature at reference height 2 m above canopy in current time step (deg C)

k

vector of thermal conductances between layers (W / m^2 / K) (see details)

cd

thermal heat capacity of layers (J / m^3 / K)

f

forward / backward weighting of algorithm (see details)

X

vector of temperatures to be added resulting from e.g. leaf heat fluxes or radiation absorbed by top soil layer

Details

The vector tc must be ordered with reference air temperature first and the soil temperature of the deepest layer last. I.e. the length of the vector tc is the number of nodes + 2. The vector k is the conductivity between each node and that diectly below it, the first value representing conductivity between reference height and the top canopy node. I.e. the length of the vector k is the number of nodes + 1. The vector cd is the heat storage at each node. I.e. the length of the vector cd is the same as the number of nodes. The weighting factor f may range from 0 to 1. If f = 0, the flux is determined by the temperature difference at the beginning of the time step. If f = 0.5, the average of the old and new temperatures is used to compute heat flux. If f = 1, fluxes are computed using only the new temperatures. The best value to use for f is determined by considerations of numerical stability and accuracy and experimentation may be required. If f = 0 more heat transfer between nodes is predicted than would actually occur, and can therefore become unstable if time steps are too large. When f > 0.5, stable solutions will always be obtained, but heat flux will be underestimated. The best accuracy is obtained with f around 0.4, while best stability is at f = 1. A typical compromise is f = 0.6.

Value

a vector of temperatures (deg C) for each soil / air layer for current time step. The first value is tair and the last tmsoil


ilyamaclean/microclimc documentation built on July 28, 2023, 1:40 a.m.