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
6b2c439e
Commit
6b2c439e
authored
2 years ago
by
Brian Groenke
Browse files
Options
Downloads
Patches
Plain Diff
Apply snow thermal properties by component
parent
2bfad2ed
No related branches found
No related tags found
1 merge request
!89
Add simple bulk snow scheme
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Physics/Snow/Snow.jl
+2
-8
2 additions, 8 deletions
src/Physics/Snow/Snow.jl
src/Physics/Snow/snow_bulk.jl
+4
-5
4 additions, 5 deletions
src/Physics/Snow/snow_bulk.jl
with
6 additions
and
13 deletions
src/Physics/Snow/Snow.jl
+
2
−
8
View file @
6b2c439e
...
...
@@ -24,17 +24,12 @@ abstract type SnowParameterization <: CryoGrid.Parameterization end
Simple, bulk snow scheme where snowpack is represented as a single grid cell with homogenous state.
"""
Base
.
@kwdef
struct
Bulk
{
Tdsn
,
Tthresh
}
<:
SnowParameterization
Base
.
@kwdef
struct
Bulk
{
Tdsn
,
Tρsn
,
Tthresh
}
<:
SnowParameterization
dsn
::
Tdsn
=
0.0
u
"m"
# snow depth
ρsn
::
Tρsn
=
250.0
u
"kg/m^3"
# bulk snow density
thresh
::
Tthresh
=
0.05
u
"m"
# snow threshold
end
Base
.
@kwdef
struct
SnowThermalProperties
{
Tρ
,
Tk
,
Tc
}
<:
HeatConduction
.
ThermalProperties
ρsn
::
Tρ
=
350.0
u
"kg/m^3"
# bulk snow density
ksn
::
Tk
=
0.5
u
"W/m/K"
# thermal conductivity of fresh snow (Westermann et al. 2011)
csn
::
Tc
=
7.5e6
u
"J/K/m^3"
# heat capacity of snow (Westermann et al. 2011)
end
struct
SnowFree
<:
CryoGrid
.
Callback
end
CryoGrid
.
CallbackStyle
(
::
Type
{
SnowFree
})
=
CryoGrid
.
Continuous
()
...
...
@@ -45,7 +40,6 @@ Generic representation of a ground surface snow pack.
"""
Base
.
@kwdef
struct
Snowpack
{
TPara
<:
SnowParameterization
,
TProp
,
TSp
}
<:
CryoGrid
.
SubSurface
para
::
TPara
=
Bulk
()
prop
::
TProp
=
SnowThermalProperties
()
sp
::
TSp
=
nothing
end
...
...
This diff is collapsed.
Click to expand it.
src/Physics/Snow/snow_bulk.jl
+
4
−
5
View file @
6b2c439e
...
...
@@ -29,10 +29,7 @@ end
snowdepth
(
snow
::
BulkSnowpack
{
<:
Number
},
state
)
=
snow
.
para
.
dsn
snowdepth
(
snow
::
BulkSnowpack
{
<:
Forcing
},
state
)
=
snow
.
para
.
dsn
(
state
.
t
)
Physics
.
volumetricfractions
(
::
BulkSnowpack
,
::
Heat
,
state
,
i
)
=
(
1.0
,)
HeatConduction
.
thermalconductivities
(
snow
::
Snowpack
,
::
Heat
)
=
(
snow
.
prop
.
ksn
,)
HeatConduction
.
heatcapacities
(
snow
::
Snowpack
,
::
Heat
)
=
(
snow
.
prop
.
csn
,)
snowdensity
(
snow
::
BulkSnowpack
,
state
)
=
snow
.
para
.
ρsn
# CryoGrid methods
CryoGrid
.
thickness
(
::
BulkSnowpack
,
state
)
=
getscalar
(
state
.
dsn
)
...
...
@@ -42,12 +39,14 @@ function CryoGrid.diagnosticstep!(snow::BulkSnowpack, state)
end
function
CryoGrid.diagnosticstep!
(
snow
::
BulkSnowpack
,
heat
::
Heat
{
FreeWater
,
Enthalpy
},
state
)
dsn
=
getscalar
(
state
.
dsn
)
@.
state
.
θwi
=
snow
.
prop
.
ρsn
/
heat
.
prop
.
ρw
ρsn
=
snowdensity
(
snow
,
state
)
@.
state
.
θwi
=
ρsn
/
heat
.
prop
.
ρw
if
dsn
>
snow
.
para
.
thresh
@.
state
.
θwi
=
snow
.
prop
.
ρsn
/
heat
.
prop
.
ρw
HeatConduction
.
freezethaw!
(
snow
,
heat
,
state
)
else
@.
state
.
θwi
=
0.0
@.
state
.
θw
=
0.0
@.
state
.
T
=
state
.
T_ub
@.
state
.
C
=
heat
.
prop
.
ca
end
...
...
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