<div dir="ltr">Thanks for the answer, I will read the mentioned example, but to clarify for Barry I will schematize the process:<div><br></div><div>At time n, the program need to do all of these at once:</div><div><ol><li>Solve T as a function of u,v,w </li><li>Solve S as a function of u,v,w</li><li>Solve rho density as a function of T,S</li><li>Derivate a correction of the velocity fields from the density </li><li>Solve u,v,w being corrected by the density field</li></ol><div>What I have implemented so far:</div></div><div><ol><li>Advance TS1 to solve for T</li><li>Advance TS2 to solve for S<br></li><li>Solve rho and calculate correction</li><li>Advance TS3 to solve for u,v,w<br></li></ol><div>Or, altenatively:</div><div><ol><li>Advance TS to solve for T,S,u,v,w at the same time.</li><li>Solve rho and calculate correction</li></ol></div><div>Both implementation are lacking the feedback from the T,S <-> rho <-> Velocities interaction, and is creating problems when using a bigger DT.<br></div></div><div><br></div><div>All the systems from the first numeration are different algorithms, and each TS in the 2nd numeration generate a different RHS. </div><div><br></div><div>What Jed is suggesting is to create an overarching routine that does all that is the first list under one single step? </div><div><br></div><div>Thanks,</div><div><br></div><div> </div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 9, 2019 at 3:24 PM Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Manuel Valera via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> writes:<br>
<br>
> Hello,<br>
><br>
> I have a set of equations which are co-dependent when integrating in time,<br>
> this means the velocities u,v,w need a component from the Temperature and<br>
> Salinity integration at the same intermediate step. Same for Temperature<br>
> and Salinity, which need the current velocities (at the intermediate time<br>
> stages) to be computed accurately.<br>
<br>
There's nothing special about having different fields.  Just evaluate<br>
the RHS function of the coupled system.  There are examples (e.g.,<br>
ts/examples/tutorials/ex9.c) of doing this for systems like shallow<br>
water (momentum coupled with thickness).<br>
<br>
> My question is, how to feed the information of the updated temperature<br>
> inside the velocity, and vice-versa? this would be equivalent, I think, to<br>
> obtaining the intermediate stages of the time integration so they can be<br>
> the input for the next intermediate stage.<br>
><br>
> Thanks,<br>
</blockquote></div>