# rho residual always zero, why? sonicFoam, OF 5.x

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 23, 2018, 13:08 rho residual always zero, why? sonicFoam, OF 5.x #1 Senior Member   Deep Join Date: Oct 2017 Posts: 180 Rep Power: 7 Hello, As the title clearly says, when I run my case, I noticed that the density residual is always zero irrespective of the iterations, from start till end. That clearly means density is not changing. I find that weird, especially when this is compressible flow and am expecting shock(supersonic) which is seen in paraview. Code: PIMPLE: iteration 10 DILUPBiCG: Solving for Ux, Initial residual = 1.87677e-14, Final residual = 1.87677e-14, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 5.61674e-14, Final residual = 5.61674e-14, No Iterations 0 DILUPBiCG: Solving for Uz, Initial residual = 2.02128e-06, Final residual = 1.9697e-10, No Iterations 1 DILUPBiCG: Solving for e, Initial residual = 5.28336e-10, Final residual = 5.28336e-10, No Iterations 0 DILUPBiCG: Solving for p, Initial residual = 6.99711e-15, Final residual = 6.99711e-15, No Iterations 0 DILUPBiCG: Solving for p, Initial residual = 6.99711e-15, Final residual = 6.99711e-15, No Iterations 0 DILUPBiCG: Solving for p, Initial residual = 6.99711e-15, Final residual = 6.99711e-15, No Iterations 0 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 1.3329e-13, global = 9.97659e-14, cumulative = 0.00178268 DILUPBiCG: Solving for p, Initial residual = 6.99712e-15, Final residual = 6.99712e-15, No Iterations 0 DILUPBiCG: Solving for p, Initial residual = 6.99712e-15, Final residual = 6.99712e-15, No Iterations 0 DILUPBiCG: Solving for p, Initial residual = 6.99712e-15, Final residual = 6.99712e-15, No Iterations 0 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 1.3329e-13, global = 9.97659e-14, cumulative = 0.00178268 DILUPBiCG: Solving for p, Initial residual = 6.99712e-15, Final residual = 6.99712e-15, No Iterations 0 DILUPBiCG: Solving for p, Initial residual = 6.99712e-15, Final residual = 6.99712e-15, No Iterations 0 DILUPBiCG: Solving for p, Initial residual = 6.99712e-15, Final residual = 6.99712e-15, No Iterations 0 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 1.3329e-13, global = 9.97659e-14, cumulative = 0.00178268 DILUPBiCG: Solving for epsilon, Initial residual = 9.92238e-05, Final residual = 1.60427e-11, No Iterations 2 DILUPBiCG: Solving for k, Initial residual = 7.98564e-05, Final residual = 3.05053e-11, No Iterations 2 ExecutionTime = 87132.1 s ClockTime = 91714 s What am I missing? Why is the residual always zero? Can anyone give me any pointers?

 March 26, 2018, 03:35 #2 Senior Member   Tom Fahner Join Date: Mar 2009 Location: Breda, Netherlands Posts: 603 Rep Power: 30 Hi, Did you check your results to actually see if the density is changing? As you are using the diagonal solver, the residual will be zero, since you have only terms on the diagonal of the matrix that you are solving for. So all cells are uncoupled which means you just solve the equation of state within each cell. Therefore there you just solve the simple ax=b within each cell. Hope this helps, Tom Jiss, bikooo3878 and deepbandivadekar like this.

March 26, 2018, 11:01
#3
Senior Member

Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 7
Quote:
 Originally Posted by tomf Hi, As you are using the diagonal solver, the residual will be zero, since you have only terms on the diagonal of the matrix that you are solving for. So all cells are uncoupled which means you just solve the equation of state within each cell. Therefore there you just solve the simple ax=b within each cell. Hope this helps, Tom
Okay, that makes sense. That would definitely make residual zero.

Quote:
 Did you check your results to actually see if the density is changing?
How do I check that? That is, say plot the density field in post-processing
I came across this thread here: How to get density-field for compressible flow?
But it seems to be tool old. I am using OF 5.x

 March 26, 2018, 11:40 #4 Senior Member   Tom Fahner Join Date: Mar 2009 Location: Breda, Netherlands Posts: 603 Rep Power: 30 Hi, Not tested, but this may work: Code: writeObjects1 { type writeObjects; libs ("libutilityFunctionObjects.so"); objects (rho); writeOption autoWrite; } source: Source code guide Regards, Tom

March 26, 2018, 11:55
#5
Senior Member

Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 7
Quote:
 Originally Posted by tomf Hi, Not tested, but this may work: Code: writeObjects1 { type writeObjects; libs ("libutilityFunctionObjects.so"); objects (rho); writeOption autoWrite; } source: Source code guide Regards, Tom
Alright. Let me try this. Since this is useful for runtime only I'll know only after I finish this run.
I was actually looking up any post-processing utility but didn't find any so far.

Thanks a lot.

 Tags density, openfoam 5.x, residual, rho, sonicfoam