void Foam::fv::limitTemperature::correct(volScalarField& he) { const basicThermo& thermo = mesh_.lookupObject<basicThermo>(basicThermo::dictName); scalarField Tmin(cells_.size(), Tmin_); scalarField Tmax(cells_.size(), Tmax_); scalarField heMin(thermo.he(thermo.p(), Tmin, cells_)); scalarField heMax(thermo.he(thermo.p(), Tmax, cells_)); scalarField& hec = he.internalField(); forAll(cells_, i) { label cellI = cells_[i]; hec[cellI]= max(min(hec[cellI], heMax[i]), heMin[i]); }
void compute(const vle::devs::Time& /* t */) { PAR = 0.5 * 0.01 * RG(); Tmean = std::max(0.0, (Tmin() + Tmax()) / 2); if (SemRec() == 2) { SemRecVar = 0; } else if (SemRec() == 1) { SemRecVar = 1; } if (SemRecVar() == 0) { ST = 0; LAI = 0; } else if (SemRecVar() == 1) { ST = ST() + Tmean(); LAI = std::max(0.0, Lmax() * ((1 / (1 + std::exp(-A() * (ST() - TI())))) - std::exp(B() * (ST() - Tr())))); } U = U(-1) + Eb() * Eimax() * (1 - std::exp(-K() * LAI())) * PAR(); }
static inline T Tmin(T x_,T y_,T z_,T w_) { return Tmin(Tmin(x_,y_),Tmin(z_,w_)); };
static inline T Tmin(T x_,T y_,T z_) { return Tmin(Tmin(x_,y_),z_); };