Skip to content

Commit

Permalink
Merge branch 'main' into allocation_output_file
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Nov 6, 2023
2 parents d7af65a + 5ecfd83 commit c043d16
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 11 deletions.
3 changes: 3 additions & 0 deletions build/create_binaries/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"

[compat]
Artifacts = "1"
LibGit2 = "1"
PackageCompiler = "2"
TOML = "1"
TimeZones = "=1.13.0"
julia = "1.9"
2 changes: 2 additions & 0 deletions build/libribasim/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"

[compat]
BasicModelInterface = "0.1"
Dates = "1"
TOML = "1"
julia = "1.9"
3 changes: 3 additions & 0 deletions build/ribasim_cli/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"

[compat]
Dates = "1"
Logging = "1"
TOML = "1"
julia = "1.9"
3 changes: 3 additions & 0 deletions core/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ DBInterface = "2.4"
DataFrames = "1.4"
DataInterpolations = "4.4"
DataStructures = "0.18"
Dates = "1"
Dictionaries = "0.3.25"
DiffEqCallbacks = "2.29.1"
FiniteDiff = "2.21"
Expand All @@ -57,11 +58,13 @@ HiGHS = "1.7"
IterTools = "1.4"
JuMP = "1.15"
Legolas = "0.5"
Logging = "1"
LoggingExtras = "1"
OrdinaryDiffEq = "6.7"
PreallocationTools = "0.4"
SQLite = "1.5.1"
SciMLBase = "1.60, 2"
SparseArrays = "1"
StructArrays = "0.6.13"
Tables = "1"
TerminalLoggers = "0.1.7"
Expand Down
9 changes: 9 additions & 0 deletions core/test/run_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ end
)
# flows are recorded at the end of each period, and are undefined at the start
@test unique(table.time) == Ribasim.datetimes(model)[2:end]

# inflow = outflow over FractionalFlow
t = table.time[1]
@test length(p.fractional_flow.node_id) == 3
for id in p.fractional_flow.node_id
inflow = only(table.flow[table.to_node_id .== id .&& table.time .== t])
outflow = only(table.flow[table.from_node_id .== id .&& table.time .== t])
@test inflow == outflow
end
end

@testset "basic transient model" begin
Expand Down
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"

[compat]
Documenter = "0.27"
DocumenterMarkdown = "0.2"
InteractiveUtils = "1"
JSON3 = "1.12"
OrderedCollections = "1.6"
julia = "1.9"
2 changes: 1 addition & 1 deletion docs/core/usage.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ node_id | Int | - | sorted
active | Bool | - | (optional, default true)
length | Float64 | $m$ | positive
manning_n | Float64 | $s m^{-\frac{1}{3}}$ | positive
profile_with | Float64 | $m$ | positive
profile_width | Float64 | $m$ | positive
profile_slope | Float64 | - | -
control_state | String | - | (optional)

Expand Down
8 changes: 0 additions & 8 deletions docs/couple/modflow.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,10 @@ groundwater response to Ribasim.
From Ribasim's perspective, the groundwater head is constant given a timestep,
so that:

$$
\begin{align}
p = -C \\
q = -C\phi
\end{align}
$$

When the head falls below the drainage elevation, the coefficients are 0.

Expand All @@ -249,22 +247,18 @@ When the head falls below the drainage elevation, the coefficients are 0.
From Ribasim's perspective, infiltration is never limited when the head falls below
the bottom:

$$
\begin{align}
p = -C \\
q = -Cb
\end{align}
$$

Otherwise, infiltration and drainage occur with the same equation as for the
drainage package:

$$
\begin{align}
p = -C \\
q = -C\phi
\end{align}
$$


# Assigning MODFLOW water levels
Expand All @@ -273,12 +267,10 @@ Principally, MODFLOW deals with water levels; Ribasim deals with water volumes.
The translation from a water volume to a water level for a single boundary
condition is straightforward:

$$
\begin{align}
\Delta d = \frac{\Delta V}{A} \\
h = b + d
\end{align}
$$

Where $d$ is water depth, $V$ is volume, $A$ is area, $h$ is water level, and
$b$ is the bed elevation.
Expand Down
4 changes: 2 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ build-julia-docs = { cmd = "julia --project=docs docs/make.jl", depends_on = [
"instantiate-julia-docs",
] }
quartodoc-build = "cd docs && quartodoc build && rm objects.json"
quarto-preview = { cmd = "quarto preview docs", depends_on = [
quarto-preview = { cmd = "export QUARTO_PYTHON=python && quarto preview docs", depends_on = [
"quartodoc-build",
] }
quarto-check = { cmd = "quarto check all", depends_on = ["quartodoc-build"] }
Expand Down Expand Up @@ -73,7 +73,7 @@ build = { depends_on = ["build-ribasim-cli", "build-libribasim"] }
test-ribasim-python = "pytest --numprocesses=auto python/ribasim/tests"
test-ribasim-api = "pytest --basetemp=python/ribasim_api/tests/temp --junitxml=report.xml python/ribasim_api/tests"
test-ribasim-cli = "pytest --numprocesses=auto --basetemp=build/ribasim_cli/tests/temp --junitxml=report.xml build/ribasim_cli/tests"
test-ribasim-core = { cmd = "julia --project=core --eval 'Pkg.test()'", depends_on = [
test-ribasim-core = { cmd = "julia --project=core --eval 'using Pkg; Pkg.test()'", depends_on = [
"instantiate-julia-core",
"generate-testmodels",
] }
Expand Down

0 comments on commit c043d16

Please sign in to comment.