pohlan / SimpleSheet.jl

0 stars 0 forks source link

Trying two e_v: one physical on as numerical regularization #4

Closed mauro3 closed 3 years ago

mauro3 commented 3 years ago

Seems to do the job except that h[2,:] is wrong: image

mauro3 commented 3 years ago

Ok, issue reported above is fixed by resetting dphidt=0 at the edge. Now get image

pohlan commented 2 years ago

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:

  1. With bc for 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-L96

100d_h_bc_correct

  1. when commenting out bc for h:

100d_no_h_bc

Note: 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).

mauro3 commented 2 years ago

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

pohlan commented 2 years ago

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

mauro3 commented 2 years ago

I haven't tried for masscons=true yet. Will report once I do.