Closed mauro3 closed 3 years ago
Ok, issue reported above is fixed by resetting dphidt=0 at the edge. Now get
As I explained in https://github.com/pohlan/SimpleSheet.jl/pull/5#commitcomment-59505648, it is not sufficient to set dϕdt[1,:] .= 0
at the Dirichlet boundary as the update of h
still depends on div_q
(when the B&P equation is used for h
), therefore one needs boundary conditions for h
as well.
I fixed this in 84a9604 (on main branch). Here is a comparison, running with use_masscons_for_h=true
for 100 days:
h
, calculated from dhdt = Σ vo - Γ vc
equation:
https://github.com/pohlan/SimpleSheet.jl/blob/84a9604fd2bd38e24f4901af4a4abfcf69ca49af/run_it_diffeq_expl_two_e_v.jl#L66
https://github.com/pohlan/SimpleSheet.jl/blob/84a9604fd2bd38e24f4901af4a4abfcf69ca49af/run_it_diffeq_expl_two_e_v.jl#L94-L96Note: In this case it also works for h[2,:]=1
, but in https://github.com/pohlan/SimpleSheet.jl/pull/5#commitcomment-59510828 it didn't (reason unknown).
I just had a look at this in my other PR #10, there I set dphidt[1:2,:]=0
as index 1 doesn't "count" anyway. See
But does it work for use_masscons_for_h=true
? It shouldn't since div_q
is not known here
https://github.com/pohlan/SimpleSheet.jl/blob/788936e9b8e4d2a9dcffbcb4f480a599fe71bd3f/run_it_diffeq_impl-sundials.jl#L132-L134
I haven't tried for masscons=true yet. Will report once I do.
Seems to do the job except that h[2,:] is wrong: