Set state variable to fixed value

26 views
Skip to first unread message

David Amptmeijer

unread,
Mar 16, 2021, 12:43:35 PM3/16/21
to FABM-users
Dear FABM-users,

I and some people working on FABM from my department are running into the problem where we would like to update a state variable to a set value in the next time step. We can, however, only find out how to give the variable a rate of change per second.

I was wondering if there is a way to give a state variable instead of a rate of change a new value in some instances? We would like to do this because in our model we use partitioning equilibria that are assumed to be near-instant in the literature. Additionally, it would allow as to manage what happens to negative values due to overshoot in a mass consistent way.

I tried searching on the wiki but couldn't find it and I also tried filling in a rate per second that would end at the correct amount but had no luck with that so far. So if anybody could help me in the right direction that would be very greatly appreciated.

Kind regards

David Amptmeijer

Jorn Bruggeman

unread,
Mar 16, 2021, 2:30:02 PM3/16/21
to fabm-...@googlegroups.com

Hi David,

 

Typically when equilibration is (near) instantaneous, I would try to represent the individual members of the underlying reaction equation with diagnostics, not with state variables. For instance, for chemical compounds that have a dissolved and an adsorbed phase, I’d model the total of that compound as a state variable. At each time step you can then compute the concentration of the dissolved and adsorbed fractions as diagnostics, using the total and the partition coefficient. In that case, some properties of the total (e.g. sinking rate) are weighted means of the behaviour of the different phases, but that can be accommodated. For instance,

 

https://github.com/fabm-model/fabm/blob/master/src/models/akvaplan/antiparasitic.F90

 

Still this won’t fit all needs. If you are dealing with complicated reactions with many participants, it can be very difficult to identify a subset of variables to describe the state. If really needed, overwriting the value of state variables can be done in FABM with the check_state family of routines, as used here

 

https://github.com/fabm-model/fabm/blob/master/src/models/iow/age/iow_age.F90

 

Not all hosts [hydrodynamic models] supports this though – some only allow state updates through “normal” time integration of source and transport terms.

 

Cheers,

 

Jorn

--
You received this message because you are subscribed to the Google Groups "FABM-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fabm-users/620025db-06a0-4f83-a8dc-b8806b8dd0cen%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages