Dear mailinglist, I am trying to solve a convection problem where the convected substance is adsorbed (on active carbon in this case). It is modeled as follows: the fluid is divided in a bulk part and in a film layer part; that is the film layer surrounding the adsorbing medium (active carbon). To the concentration in the bulk applies a convective equation with a sink for the part of the solute that is diffusing into the film layer; the sink depends on the difference between film and bulk concentration. The film layer thus receives the solute from the bulk and loses it to the adsorbing medium and is therefore modeled as an equation with only a sink and a source; the source depends on the concentration difference between bulk and film, the sink depends on the 'concentration' difference between the surface and the center of active carbon grains. Finally, I also modeled the diffusion of the solute from the surface of the active carbon to its center; this source term depends on the difference between solution at the surface and center of the grain.
c_b: bulk concentration c_f: film concentration q_s: concentration at the surface of the grain (this is not really a concentration, but the amount of adsorbed material per amount of adsorbing material (active carbon) q_b: the concentration in the center of the grain This then yields the following equations: dc_b/dt = v dc_b/dx - A1(c_b - c_f) dc_f/dt = A2 (c_b - c_f) - A3(q_s - q_b) dq_s/dt = A4(q_s - q_b) here A1, A2, A3 and A4 are some mass transfer constants. Furthermore, q_s relates to c_f by the Freundlich equation: q_s = K_Fr * c_f ^n_Fr with K_Fr and n_Fr some constants. As n_Fr is smaller than zero, q_s will yield NaN if c_f becomes smaller than zero. As c_f is a concentration, it cannot become smaller than 0 from a physics point of view. Indeed this is enforced by the equations. However, due to some numerical inaccuracies, c_f sometimes becomes smaller than zero and solutions fail. Is it possible to put a constraint on the values of c_f so that the solver will only return solutions that comply to this constraint? Best regards, M.W. (Martin) Korevaar, MSc Scientific researcher - Drinking Water Treatment | KWR Watercycle Research Institute | Groningenhaven 7, P.O. Box 1072, 3430 BB Nieuwegein, the Netherlands [http://www.kwrwater.nl/uploadedImages/mail/gmaps.png] <https://maps.google.nl/maps?q=Groningenhaven+7,+3433+PE+Nieuwegein&hl=nl&sll=52.212992,5.27937&sspn=4.678847,13.392334&t=m&hnear=Groningenhaven+7,+3433+PE+Nieuwegein,+Utrecht&z=16> | T +31 30 606 9515 | M +31 6 11648156 | E martin.korev...@kwrwater.nl<mailto:martin.korev...@kwrwater.nl> | W www.kwrwater.nl<http://www.kwrwater.nl> | Follow KWR on [http://www.kwrwater.nl/uploadedImages/mail/twitter.png] <http://www.twitter.com/kwr_water> | Follow me on [http://www.kwrwater.nl/uploadedImages/mail/linkedin.png] <https://nl.linkedin.com/in/martinkorevaar> | Chamber of Commerce Utrecht e.o. 27279653. The KWR office building<http://www.kwrwater.nl/BNA_Gebouw_van_het_Jaar/> has won the 'Most Stimulating Environment' award of the Royal Institute of Dutch Architects.
_______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]