diff --git a/Project.toml b/Project.toml index bdc88c13834039a21c4a1af20ae675a82e5ec0aa..8a45647e3add22cf76a4b8433ab1ce1c8a0bdba6 100755 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CryoGrid" uuid = "a535b82e-5f3d-4d97-8b0b-d6483f5bebd5" authors = ["Brian Groenke <brian.groenke@awi.de>", "Jan Nitzbon <jan.nitzbon@awi.de>", "Moritz Langer <moritz.langer@awi.de>"] -version = "0.23.0" +version = "0.23.1" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/src/Physics/Heat/Heat.jl b/src/Physics/Heat/Heat.jl index 80df1983d6ce47cd4774495a78fe3d580b3f705d..63712fe293ccbf8c29f32dc3ce9f2bd8a222a9b0 100644 --- a/src/Physics/Heat/Heat.jl +++ b/src/Physics/Heat/Heat.jl @@ -29,7 +29,7 @@ include("thermal_properties.jl") export HeatBC, ConstantTemperature, GeothermalHeatFlux, TemperatureBC, GroundHeatFlux, NFactor include("heat_bc.jl") -export LinearTwoPhaseInitialTempProfile, ThermalSteadyStateInit +export PermafrostTemperatureInit, ThermalSteadyStateInit include("heat_init.jl") export heatconduction! diff --git a/src/Physics/Heat/heat_init.jl b/src/Physics/Heat/heat_init.jl index 004f3a1354308dff01ae3679211e34b9c5ddfdc1..66dbf1d8e55fd317499f7d8802e506aa57c17bb8 100644 --- a/src/Physics/Heat/heat_init.jl +++ b/src/Physics/Heat/heat_init.jl @@ -1,44 +1,44 @@ """ - LinearTwoPhaseTempProfile{TT1,TT2,TTb,TTm,Tz1,Tz2,Tz3,Tz4} <: VarInitializer{:T} + PermafrostTemperatureInit{TT1,TT2,TTb,TTm,Tz1,Tz2,Tz3,Tz4} <: VarInitializer{:T} Simple, piecewise linear temprature initializer that uses three temperature values and four characteristic depths to initialize the temperature profile. `T0` is the -initial surface temperature, `T1` is the permafrost temperature at `z_deep`, +initial surface temperature, `Tpf` is the permafrost temperature at `z_deep`, `z_thaw` and `z_base` are the top and bottom freezing fronts which are both assumed to be have temperature equal to `Tm`. """ -Base.@kwdef struct LinearTwoPhaseTempProfile{TT1,TT2,TTb,TTm,Tz1,Tz2,Tz3,Tz4} <: VarInitializer{:T} - T0::TT1 = 1.0u"°C" - T1::TT2 = -10.0u"°C" - Tm::TTm = 0.0u"°C" - Tbot::TTb = 10.0u"°C" - z_top::Tz1 = 0.0u"m" - z_deep::Tz2 = 20.0u"m" - z_thaw::Tz3 = 0.5u"m" - z_base::Tz4 = 500.0u"m" +Base.@kwdef struct PermafrostTemperatureInit{TT1,TT2,TTb,TTm,Tz1,Tz2,Tz3,Tz4} <: VarInitializer{:T} + T0::TT1 = 1.0u"°C" # surface temperature + Tpf::TT2 = -10.0u"°C" # permafrost temperature + Tm::TTm = 0.0u"°C" # melting point + Tbot::TTb = 10.0u"°C" # bottom temperature + z0::Tz1 = 0.0u"m" # surface depth + z_thaw::Tz3 = 0.5u"m" # thaw depth (top of permafrost) + z_pf::Tz2 = 20.0u"m" # depth of peramfrost temperature + z_base::Tz4 = 500.0u"m" # depth of permafrost base end -(init::LinearTwoPhaseTempProfile)(::SubSurface, state) = init(state.T, state.grid) +(init::PermafrostTemperatureInit)(::SubSurface, state) = init(state.T, state.grid) """ - (init::LinearTwoPhaseTempProfile)(T::AbstractVector, grid::Grid) + (init::PermafrostTemperatureInit)(T::AbstractVector, grid::Grid) Evaluate the initializer on the given temperature vector `T` which should match the length of `cells(grid)`. """ -function (init::LinearTwoPhaseTempProfile)(T::AbstractVector, grid::Grid) +function (init::PermafrostTemperatureInit)(T::AbstractVector, grid::Grid) @assert length(T) == length(cells(grid)) T0 = ustrip(init.T0) - T1 = ustrip(init.T1) + Tpf = ustrip(init.Tpf) Tbot = ustrip(init.Tbot) Tm = ustrip(init.Tm) - z_top = ustrip(init.z_top) - z_deep = ustrip(init.z_deep) + z0 = ustrip(init.z0) + z_deep = ustrip(init.z_pf) z_thaw = ustrip(init.z_thaw) z_base = ustrip(init.z_base) z_bot = parent(grid)[end] - Ts = [T0, Tm, T1, Tm, Tbot] - zs = [z_top, z_thaw, z_deep, z_base, z_bot] + Ts = [T0, Tm, Tpf, Tm, Tbot] + zs = [z0, z_thaw, z_deep, z_base, z_bot] f = Interp.extrapolate(Interp.interpolate((zs,), Ts, Interp.Gridded(Interp.Linear())), Interp.Flat()) # evaluate interpolant at grid cell midpoints T .= f.(cells(grid))