Hi Dmitry, I think you are misinterpreting the threshold adjustment.
If the threshold is higher if the phase state already switched in the last iteration. That means in the last iteration both phases where present and one disappeared. In order to prevent the Newton from switching back and forth between states every iteration the threshold is slightly increased in the iteration after the switch. This doesn’t alter the result since the Newton will always perform at least one more iteration after a switch, it just tries to keep the Newton more stable. It could be interpreted as some kind of chop / semi-smooth Newton. Best regards Timo > On 30. Mar 2021, at 16:36, Dmitry Pavlov <[email protected]> wrote: > > >> I have to switch primary variables, similarly to what Etienne said, from >> secondPhaseOnly to bothPhases. So I implemented my own PrimaryVariableSwitch. >> > I see in TwoPTwoCCO2PrimaryVariableSwitch that the switch is not necessarily > done when the condition xnw > xnwMax is met (xnw is mole fraction, xnwMax is > the maximum mole fraction that is allowed in one phase). > > For the switch to happen, xnw should exceed xnwMax, and then (on next call, I > am not sure whether it happens on the same time step or not), xnw should > exceed xnwMax * 1.02. Only then the switch is made. > > I do not understand at the moment why such a two-step switch procedure was > needed for. > > > Best regards, > > Dmitry > > > _______________________________________________ > DuMux mailing list > [email protected] > https://listserv.uni-stuttgart.de/mailman/listinfo/dumux _______________________________________________ DuMux mailing list [email protected] https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
