I have a multiphysics problem, where I have a coupled, PDEs, and and one of them needs the viscosity to be updated. The updating formula uses both the concentration of a substance (from the transport equation), and the velocity (this comes from the other equation. The problem is, the velocity needs the viscosity as well, hence the recursivity. Of course, one can set initial values, but then, I would like to do something similar as in the imperative languages (Fortran, C), where you can set
set initial viscosity
FOR time =1 to N, step deltat
solve flow equation (with a given viscosity for the fluid)
solve transport equation
update viscosity with formula
viscosity(t+1)= viscosity (t) + concentration/velocity
NEXT time step
Can it be done without resorting to MATLAB? if so, how?
I tried on MATLAB, but I couldn't figure out how to call the model, it kept telling me that it could not be found. I do not know if it was that I didn't set a proper path, or was it the loop or something more subtle about the way this recursive functionality must be set up.