diff --git a/src/Physics/HeatConduction/heat_bc.jl b/src/Physics/HeatConduction/heat_bc.jl index e7ea2fdf7135e2c204e09bd0f34872c4b2863eaa..4b793ee31eb64b76d02ba55a3a6c9faa4089bd7a 100644 --- a/src/Physics/HeatConduction/heat_bc.jl +++ b/src/Physics/HeatConduction/heat_bc.jl @@ -15,12 +15,12 @@ BoundaryStyle(::Type{<:TemperatureGradient{<:Damping}}) = Neumann() @inline boundaryvalue(bc::TemperatureGradient, l1, p2, l2, s1, s2) = bc.T(s1.t) @with_kw struct NFactor{W,S} <: BoundaryEffect - winterfactor::W = Param(1.0, bounds=(0.0,1.0)) # applied when Tair <= 0 - summerfactor::S = Param(1.0, bounds=(0.0,1.0)) # applied when Tair > 0 + nf::W = Param(1.0, bounds=(0.0,1.0)) # applied when Tair <= 0 + nt::S = Param(1.0, bounds=(0.0,1.0)) # applied when Tair > 0 end @inline function boundaryvalue(bc::TemperatureGradient{<:NFactor}, l1, ::Heat, l2, s1, s2) - let nfw = bc.effect.winterfactor, - nfs = bc.effect.summerfactor, + let nfw = bc.effect.nf, + nfs = bc.effect.nt, Tair = bc.T(s1.t), nf = (Tair <= zero(Tair))*nfw + (Tair > zero(Tair))*nfs; nf*Tair # apply damping factor to air temperature diff --git a/test/Physics/HeatConduction/heat_conduction_tests.jl b/test/Physics/HeatConduction/heat_conduction_tests.jl index 50cffb0650f03f2dd541e521522b5e54c7a08c7f..91b11c129b81f8e483ea6f88bc9567607873da3f 100644 --- a/test/Physics/HeatConduction/heat_conduction_tests.jl +++ b/test/Physics/HeatConduction/heat_conduction_tests.jl @@ -74,7 +74,7 @@ end @testset "n-factors" begin ts = DateTime(2010,1,1):Hour(1):DateTime(2010,1,1,4) forcing = TimeSeriesForcing([1.0,0.5,-0.5,-1.0,0.1], ts, :Tair) - tgrad = TemperatureGradient(forcing, NFactor(winterfactor=0.5, summerfactor=1.0)) + tgrad = TemperatureGradient(forcing, NFactor(nf=0.5, nt=1.0)) sub = TestGroundLayer() heat = Heat() f1(t) = boundaryvalue(tgrad,Top(),heat,sub,(t=t,),(t=t,))