<div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>I'm trying to solve for fluid flows with large density and pressure variations using the theta method in the TS module. This inevitably leads to negative densities and pressures during the course of the evolution. In order to deal with this, I am trying to now solve for log(rho) and log(P) instead of rho and P. In order to do this, I changed my initial conditions for rho and P to log(rho) and log(P) and inside the residual evaluation function I keep the original code unchanged expect that I add the following lines above the original code:<br>
<br></div>rho = exp(logrho)<br></div>P = exp(logP)<br><br></div>since I expect the solution vector x[j][i] to now have logrho and logP instead of rho and P. I now run the simulation with a modified newton krylov method and lag the jacobian for every 100 linear solves. The jacobian assembly is using colored finite differences. This goes smoothly from the point I start the simulation to the first 100 linear solves after which it needs to assemble the jacobian again. At this point the nonlinear solver crashes and I think something is wrong with the jacobian assembly. I checked that the simulation runs till it has to assemble the jacobian the second time by varying the lagging by say 10, 20, 30, ... It fails everytime it has to assemble the second time.<br>
<br> When I view the solution using VecView inside TSMonitor during the time elasped when the simulation ran, the initial conditions are log(rho) and log(P) but the output of the vector actually has rho and P and not log(rho) and log(P) which I expect the solver to be solving for. However when I look at the .vts files generated by -ts_monitor_solution_vtk, the output is log(rho) and log(P). <br>
<br></div>Should I be doing something else in order to rescale the quantities that TS/SNES should solve for instead of what I did above?<br><br></div>The method suggesting that one rescales is described in this paper:<br>
"A newton-krylov solver for implicit solution of hydrodynamics in core-collapse supernova"<br><a href="http://iopscience.iop.org/1742-6596/125/1/012085/pdf/1742-6596_125_1_012085.pdf">http://iopscience.iop.org/1742-6596/125/1/012085/pdf/1742-6596_125_1_012085.pdf</a><br>
<div><br></div><div>P.S I also tried the variational inequality SNES solver a while back but it didn't really work in enforcing the constraints.<br></div><div><br>Thanks,<br>Mani<br></div></div>