Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CryoGrid.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CryoGrid
CryoGrid.jl
Commits
27b66c30
Commit
27b66c30
authored
4 months ago
by
Brian Groenke
Browse files
Options
Downloads
Patches
Plain Diff
Rename permafrost temp profile initializer
parent
df0cab50
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Project.toml
+1
-1
1 addition, 1 deletion
Project.toml
src/Physics/Heat/Heat.jl
+1
-1
1 addition, 1 deletion
src/Physics/Heat/Heat.jl
src/Physics/Heat/heat_init.jl
+19
-19
19 additions, 19 deletions
src/Physics/Heat/heat_init.jl
with
21 additions
and
21 deletions
Project.toml
+
1
−
1
View file @
27b66c30
name
=
"CryoGrid"
name
=
"CryoGrid"
uuid
=
"a535b82e-5f3d-4d97-8b0b-d6483f5bebd5"
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>"
]
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]
[deps]
Adapt
=
"79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Adapt
=
"79e6a3ab-5dfb-504d-930d-738a2a938a0e"
...
...
This diff is collapsed.
Click to expand it.
src/Physics/Heat/Heat.jl
+
1
−
1
View file @
27b66c30
...
@@ -29,7 +29,7 @@ include("thermal_properties.jl")
...
@@ -29,7 +29,7 @@ include("thermal_properties.jl")
export
HeatBC
,
ConstantTemperature
,
GeothermalHeatFlux
,
TemperatureBC
,
GroundHeatFlux
,
NFactor
export
HeatBC
,
ConstantTemperature
,
GeothermalHeatFlux
,
TemperatureBC
,
GroundHeatFlux
,
NFactor
include
(
"heat_bc.jl"
)
include
(
"heat_bc.jl"
)
export
LinearTwoPhaseInitialTempProfile
,
ThermalSteadyStateInit
export
PermafrostTemperatureInit
,
ThermalSteadyStateInit
include
(
"heat_init.jl"
)
include
(
"heat_init.jl"
)
export
heatconduction!
export
heatconduction!
...
...
This diff is collapsed.
Click to expand it.
src/Physics/Heat/heat_init.jl
+
19
−
19
View file @
27b66c30
"""
"""
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
Simple, piecewise linear temprature initializer that uses three temperature values
and four characteristic depths to initialize the temperature profile. `T0` is the
and four characteristic depths to initialize the temperature profile. `T0` is the
initial surface temperature, `T
1
` is the permafrost temperature at `z_deep`,
initial surface temperature, `T
pf
` is the permafrost temperature at `z_deep`,
`z_thaw` and `z_base` are the top and bottom freezing fronts which are both assumed
`z_thaw` and `z_base` are the top and bottom freezing fronts which are both assumed
to be have temperature equal to `Tm`.
to be have temperature equal to `Tm`.
"""
"""
Base
.
@kwdef
struct
LinearTwoPhaseTempProfile
{
TT1
,
TT2
,
TTb
,
TTm
,
Tz1
,
Tz2
,
Tz3
,
Tz4
}
<:
VarInitializer
{
:
T
}
Base
.
@kwdef
struct
PermafrostTemperatureInit
{
TT1
,
TT2
,
TTb
,
TTm
,
Tz1
,
Tz2
,
Tz3
,
Tz4
}
<:
VarInitializer
{
:
T
}
T0
::
TT1
=
1.0
u
"°C"
T0
::
TT1
=
1.0
u
"°C"
# surface temperature
T
1
::
TT2
=
-
10.0
u
"°C"
T
pf
::
TT2
=
-
10.0
u
"°C"
# permafrost temperature
Tm
::
TTm
=
0.0
u
"°C"
Tm
::
TTm
=
0.0
u
"°C"
# melting point
Tbot
::
TTb
=
10.0
u
"°C"
Tbot
::
TTb
=
10.0
u
"°C"
# bottom temperature
z
_top
::
Tz1
=
0.0
u
"m"
z
0
::
Tz1
=
0.0
u
"m"
# surface depth
z_
deep
::
Tz
2
=
2
0.
0
u
"m"
z_
thaw
::
Tz
3
=
0.
5
u
"m"
# thaw depth (top of permafrost)
z_
thaw
::
Tz
3
=
0.
5
u
"m"
z_
pf
::
Tz
2
=
2
0.
0
u
"m"
# depth of peramfrost temperature
z_base
::
Tz4
=
500.0
u
"m"
z_base
::
Tz4
=
500.0
u
"m"
# depth of permafrost base
end
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
Evaluate the initializer on the given temperature vector `T` which should match the length of
`cells(grid)`.
`cells(grid)`.
"""
"""
function
(
init
::
LinearTwoPhaseTempProfile
)(
T
::
AbstractVector
,
grid
::
Grid
)
function
(
init
::
PermafrostTemperatureInit
)(
T
::
AbstractVector
,
grid
::
Grid
)
@assert
length
(
T
)
==
length
(
cells
(
grid
))
@assert
length
(
T
)
==
length
(
cells
(
grid
))
T0
=
ustrip
(
init
.
T0
)
T0
=
ustrip
(
init
.
T0
)
T
1
=
ustrip
(
init
.
T
1
)
T
pf
=
ustrip
(
init
.
T
pf
)
Tbot
=
ustrip
(
init
.
Tbot
)
Tbot
=
ustrip
(
init
.
Tbot
)
Tm
=
ustrip
(
init
.
Tm
)
Tm
=
ustrip
(
init
.
Tm
)
z
_top
=
ustrip
(
init
.
z
_top
)
z
0
=
ustrip
(
init
.
z
0
)
z_deep
=
ustrip
(
init
.
z_
dee
p
)
z_deep
=
ustrip
(
init
.
z_p
f
)
z_thaw
=
ustrip
(
init
.
z_thaw
)
z_thaw
=
ustrip
(
init
.
z_thaw
)
z_base
=
ustrip
(
init
.
z_base
)
z_base
=
ustrip
(
init
.
z_base
)
z_bot
=
parent
(
grid
)[
end
]
z_bot
=
parent
(
grid
)[
end
]
Ts
=
[
T0
,
Tm
,
T
1
,
Tm
,
Tbot
]
Ts
=
[
T0
,
Tm
,
T
pf
,
Tm
,
Tbot
]
zs
=
[
z
_top
,
z_thaw
,
z_deep
,
z_base
,
z_bot
]
zs
=
[
z
0
,
z_thaw
,
z_deep
,
z_base
,
z_bot
]
f
=
Interp
.
extrapolate
(
Interp
.
interpolate
((
zs
,),
Ts
,
Interp
.
Gridded
(
Interp
.
Linear
())),
Interp
.
Flat
())
f
=
Interp
.
extrapolate
(
Interp
.
interpolate
((
zs
,),
Ts
,
Interp
.
Gridded
(
Interp
.
Linear
())),
Interp
.
Flat
())
# evaluate interpolant at grid cell midpoints
# evaluate interpolant at grid cell midpoints
T
.=
f
.
(
cells
(
grid
))
T
.=
f
.
(
cells
(
grid
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment