CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

buoyantSimpleFoam - not plotting residuals

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 3 Post By floquation
  • 1 Post By floquation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 24, 2016, 21:18
Default buoyantSimpleFoam - not plotting residuals
  #1
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
Hi,

after including residual function into control dict, according to this tutorial
https://www.youtube.com/watch?v=LY4jUg3lOoE
Code:
functions 
{ 
//	#includeFunc PecletNo
	#includeFunc residuals
}
I can't plot residuals for U T h, but only ofr p and p_rgh-
looking at residuals.dat only coloumns for pressures are written, does someone know the reason why?

this is the residualDict:
Code:
#includeEtc "caseDicts/postProcessing/numerical/residuals.cfg"

fields (alphat  p  p_rgh  T  U h);

Code:
# Residuals    
# Time         	p              	p_rgh          	T              	Ux             	Uy             	h              
1              	7.66141540e-01	1.00000000e+00
2              	7.98974970e-01	1.83442730e-01
3              	6.27299870e-01	7.98917170e-02
4              	7.00095750e-01	3.86347270e-02
5              	5.92908140e-01	3.04990920e-02
6              	4.58467380e-01	2.39679380e-02
7              	4.45960730e-01	2.03891940e-02
8              	4.34298940e-01	1.80788340e-02
9              	3.52051730e-01	1.59621540e-02
10             	3.76240910e-01	1.44632730e-02
Thanks a lot

regards
student666 is offline   Reply With Quote

Old   January 5, 2017, 01:47
Default
  #2
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
Hi,

I also tried the old way:
Code:
libs            ("libutilityFunctionObjects.so");
functions 
{residuals
{
    type            residuals;
    writeControl   timeStep;
    writeInterval  $deltaT;
    fields
    (  U  );
}
}
but this is the output on residuals.dat

Code:
# Residuals    
# Time         	Ux             	Uy             	Uz             
1              
2              
3              
4              
5              
6              
7              
8
any help?
student666 is offline   Reply With Quote

Old   January 6, 2017, 12:38
Default
  #3
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
If you have a look at the solver output (log file), do you see any velocity residuals?

If not, it is because "momentumPredictor" (or something like that) in "system/fvSolution" is off/false:
There are no velocity residuals if the velocity is not predicted (iterated separately) - then the velocity is fully determined by the pressure correction as to ensure continuity exactly.

I suspect this is why your residual-utility fails.
Elham, thiagopl and mn17jyf like this.
floquation is offline   Reply With Quote

Old   January 6, 2017, 18:48
Default
  #4
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
Hi, thanks you're right, but in any case, even if I set to "yes" the moment-predictor, not all variables are plotted.
residualsDict:
Code:
#includeEtc "caseDicts/postProcessing/numerical/residuals.cfg"

fields (alphat  p  p_rgh  T  U h k omega phi);
residual.dat
Code:
# Residuals    
# Time         	alphat         	p              	p_rgh          	T              	Ux             	Uy             	h              	k              	omega          
1              	8.49454040e-01	1.00000000e+00	1.00000000e+00	9.99999860e-01	1.00000000e+00	9.39029660e-02
2              	9.60117560e-03	9.93457280e-01	4.13896110e-01	2.29865230e-01	6.02265870e-01	1.66618400e-02
3              	3.29224330e-02	7.58574770e-01	8.83426870e-01	1.25890060e-01	4.81928730e-01	1.03306770e-02
log file:
Code:
Time = 9

DILUPBiCG:  Solving for Ux, Initial residual = 0.021375153, Final residual = 0.00021156612, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 0.07626579, Final residual = 0.0012698228, No Iterations 1
DILUPBiCG:  Solving for h, Initial residual = 0.029377071, Final residual = 0.0014589073, No Iterations 1
GAMG:  Solving for p_rgh, Initial residual = 0.42919448, Final residual = 0.0039295721, No Iterations 4
time step continuity errors : sum local = 0.0043774316, global = 0.0012861574, cumulative = 0.0072015916
rho max/min : 1.1888231 1.1317888
DILUPBiCG:  Solving for omega, Initial residual = 0.011685404, Final residual = 0.00053581443, No Iterations 1
bounding omega, min: -23.944772 max: 617.83442 average: 20.391699
DILUPBiCG:  Solving for k, Initial residual = 0.019885726, Final residual = 0.00063162881, No Iterations 1
ExecutionTime = 7.55 s  ClockTime = 7 s
Any other suggestion?

Quote:
If not, it is because "momentumPredictor" (or something like that) in "system/fvSolution" is off/false:
There are no velocity residuals if the velocity is not predicted (iterated separately) - then the velocity is fully determined by the pressure correction as to ensure continuity exactly.
Can you please give me more details about what does this means?

It's making me confusion.

Do you mean that velocity has no iteration (if "no" is set) and actual values for U, at current time step, are used inside pressure inner-loop of SIMPLE alghorithm?

Thanks
student666 is offline   Reply With Quote

Old   January 9, 2017, 05:27
Default
  #5
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
Quote:
Originally Posted by student666 View Post
Hi, thanks you're right, but in any case, even if I set to "yes" the moment-predictor, not all variables are plotted.
residualsDict:
Code:
#includeEtc "caseDicts/postProcessing/numerical/residuals.cfg"

fields (alphat  p  p_rgh  T  U h k omega phi);
residual.dat
Code:
# Residuals    
# Time             alphat             p                  p_rgh              T                  Ux                 Uy                 h                  k                  omega          
1                  8.49454040e-01    1.00000000e+00    1.00000000e+00    9.99999860e-01    1.00000000e+00    9.39029660e-02
2                  9.60117560e-03    9.93457280e-01    4.13896110e-01    2.29865230e-01    6.02265870e-01    1.66618400e-02
3                  3.29224330e-02    7.58574770e-01    8.83426870e-01    1.25890060e-01    4.81928730e-01    1.03306770e-02
log file:
Code:
Time = 9

DILUPBiCG:  Solving for Ux, Initial residual = 0.021375153, Final residual = 0.00021156612, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 0.07626579, Final residual = 0.0012698228, No Iterations 1
DILUPBiCG:  Solving for h, Initial residual = 0.029377071, Final residual = 0.0014589073, No Iterations 1
GAMG:  Solving for p_rgh, Initial residual = 0.42919448, Final residual = 0.0039295721, No Iterations 4
time step continuity errors : sum local = 0.0043774316, global = 0.0012861574, cumulative = 0.0072015916
rho max/min : 1.1888231 1.1317888
DILUPBiCG:  Solving for omega, Initial residual = 0.011685404, Final residual = 0.00053581443, No Iterations 1
bounding omega, min: -23.944772 max: 617.83442 average: 20.391699
DILUPBiCG:  Solving for k, Initial residual = 0.019885726, Final residual = 0.00063162881, No Iterations 1
ExecutionTime = 7.55 s  ClockTime = 7 s
Any other suggestion?
So if I understand you correctly, turning on the momentumPredictor results in the velocity residual being plotted, whereas it does not get plotted when it's off?

I don't know about the other fields - I never used the utility you are using. Therefore, the only "other" suggestions I can give you are:
pyFoamPlotWatcher.py <-- I'm using this one.
The "old" way <-- This will work, but is more elaborate.

Quote:
Originally Posted by student666 View Post
Can you please give me more details about what does this means?

It's making me confusion.

Do you mean that velocity has no iteration (if "no" is set) and actual values for U, at current time step, are used inside pressure inner-loop of SIMPLE alghorithm?

Thanks
If momentumPredictor is true, then the velocity is predicted before calculating the pressure.
In this case, there is a residual calculated for the velocity field.

If momentumPredictor is false, then the velocity from the previous timestep is taken instead.
In this case, there is no residual calculated for the velocity field. Evidently, one could still define a residual based on the new velocity and the old velocity - but it is simply not calculated afaik.
saidc. likes this.
floquation is offline   Reply With Quote

Old   January 9, 2017, 16:07
Default
  #6
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
Hi,

thanks for your reply.
About pyFoam, I already use it, but as new OF release has postProcess utility, I was digging into it to understand its capabilities.

Maybe a bug, maybe not....I'm thinking of make a bug report...

About momentum-predictor, thanks, I'm having a closer look to background theory.

Best regards.

Michele
student666 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
plotting residuals SUBHANKAR OpenFOAM Post-Processing 30 May 21, 2024 04:54
Plotting Residuals in Tecplot mkewley FLUENT 2 September 18, 2018 13:35
[PyFoam] Plotting values (e.g. residuals) from all iterations with pyFoam chriss85 OpenFOAM Community Contributions 5 November 11, 2014 12:13
Plotting residuals krembil OpenFOAM Running, Solving & CFD 2 August 16, 2014 04:38
Plotting Residuals ata OpenFOAM 12 July 8, 2011 03:50


All times are GMT -4. The time now is 17:28.