Skip to content

Commit 9643dc0

Browse files
committed
adds back grid in Problem()
1 parent 9c810da commit 9643dc0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/physics/traceradvdiff.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ abstract type AbstractSteadyFlowParams <: AbstractParams end
1414
1515
Construct a constant diffusivity problem with steady or time-varying flow.
1616
"""
17-
noflow(args...) = 0.0
17+
noflow(args...) = 0.0 # used as defaults for u, v functions in Problem()
1818

1919
Problem(; kwargs...) = ConstDiffProblem(; kwargs...) # only problem defined for now
2020

2121
function flowargs(u)
2222
umethods = methods(u)
23-
length(umethods.ms) == 1 ? umethods.ms[1].nargs-1 : error("Either define steadyflow or use a flow function
23+
length(umethods.ms) == 1 ? umethods.ms[1].nargs-1 : error("Either define steadyflow or use a flow function
2424
with only one argument.")
2525
end
2626

@@ -47,8 +47,12 @@ function ConstDiffProblem(;
4747
end
4848
end
4949

50-
if steadyflow; pr = TracerAdvDiff.ConstDiffSteadyFlowParams(eta, kap, uin, vin, g)
51-
else; pr = TracerAdvDiff.ConstDiffParams(eta, kap, uin, vin)
50+
if grid == nothing; g = TwoDGrid(nx, Lx, ny, Ly)
51+
else; g = grid
52+
end
53+
54+
if steadyflow; pr = TracerAdvDiff.ConstDiffSteadyFlowParams(eta, kap, u, v, g)
55+
else; pr = TracerAdvDiff.ConstDiffParams(eta, kap, u, v)
5256
end
5357

5458
vs = TracerAdvDiff.Vars(g)

0 commit comments

Comments
 (0)