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
f3b4caf9
Commit
f3b4caf9
authored
3 years ago
by
Brian Groenke
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug in freeW initialcondition!
parent
e18c53f1
No related branches found
No related tags found
1 merge request
!63
Fixes recent regressions in heat initialization and refactors soil state variables
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Physics/HeatConduction/soil/soilheat.jl
+7
-8
7 additions, 8 deletions
src/Physics/HeatConduction/soil/soilheat.jl
with
7 additions
and
8 deletions
src/Physics/HeatConduction/soil/soilheat.jl
+
7
−
8
View file @
f3b4caf9
...
...
@@ -14,18 +14,18 @@ end
(
liq
*
kw
^
0.5
+
ice
*
ki
^
0.5
+
mineral
*
km
^
0.5
+
organic
*
ko
^
0.5
+
air
*
ka
^
0.5
)
^
2
end
end
""" Heat capacity for soil layer """
@inline
function
heatcapacity!
(
soil
::
Soil
,
::
Heat
,
state
)
@inbounds
@.
state
.
C
=
heatcapacity
(
soil
,
state
.
θw
,
state
.
θl
,
state
.
θm
,
state
.
θo
)
end
""" Thermal conductivity for soil layer """
@inline
function
thermalconductivity!
(
soil
::
Soil
,
::
Heat
,
state
)
@inbounds
@.
state
.
kc
=
thermalconductivity
(
soil
,
state
.
θw
,
state
.
θl
,
state
.
θm
,
state
.
θo
)
end
include
(
"sfcc.jl"
)
""" Initial condition for heat conduction (all state configurations) on soil layer. """
"""
Initial condition for heat conduction (all state configurations) on soil layer.
"""
function
initialcondition!
(
soil
::
Soil
,
heat
::
Heat
,
state
)
initialcondition!
(
soil
,
state
)
L
=
heat
.
L
...
...
@@ -34,15 +34,14 @@ function initialcondition!(soil::Soil, heat::Heat, state)
heatcapacity!
(
soil
,
heat
,
state
)
@.
state
.
H
=
enthalpy
(
state
.
T
,
state
.
C
,
L
,
state
.
θl
)
end
""" Initial condition for heat conduction (all state configurations) with free water freeze curve on soil layer. """
"""
Initial condition for heat conduction (all state configurations) with free water freeze curve on soil layer.
"""
function
initialcondition!
(
soil
::
Soil
,
heat
::
Heat
{
FreeWater
},
state
)
initialcondition!
(
soil
,
state
)
L
=
heat
.
L
# initialize liquid water content based on temperature
@.
state
.
θl
=
ifelse
.
(
state
.
T
>
0.0
,
0.0
,
state
.
θ
p
)
@.
state
.
θl
=
ifelse
.
(
state
.
T
>
0.0
,
state
.
θ
w
,
0.0
)
heatcapacity!
(
soil
,
heat
,
state
)
@.
state
.
H
=
enthalpy
(
state
.
T
,
state
.
C
,
L
,
state
.
θl
)
# evaluate freeze curve
fc!
=
freezecurve
(
heat
)
fc!
(
soil
,
heat
,
state
)
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