Function for tracers #2361
Answered
by
glwagner
ammtD
asked this question in
Computational science!
-
Hi, I would like to force a tracer to a specific value at a specific time and location in my grid. Any creative suggestions on how to do this?
Any help appreciated! |
Beta Was this translation helpful? Give feedback.
Answered by
glwagner
Mar 19, 2022
Replies: 1 comment 3 replies
-
I think you'll have to chain @inline t_unforced(t) = t < ti
@inline i_unforced(i) = i < 1 | i > 3
@inline k_unforced(k) = k < 1 | k > 3
@inline unforced(i, k, t) = t_unforced(t) | i_unforced(i) | k_unforced(k)
@inline forcing(i, j, k, grid, clock, fields) = ifelse(unforced(i, k, clock.time), 0.0, 1.0)
c_forcing = Forcing(forcing, discrete_form=true) I think that will work... |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
ammtD
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you'll have to chain
|
logic in adiscrete_form
forcing function. I tried to make it readable:I think that will work...