CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

residual Field

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By marluc
  • 2 Post By tas38
  • 1 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 21, 2019, 03:28
Default residual Field
  #1
New Member
 
Eric
Join Date: Apr 2019
Location: Zwickau, Saxony, Germany
Posts: 2
Rep Power: 0
EZByK is on a distinguished road
Hello everybody,

currently I am doing steadystate RAS external aerodynamics simulation for road cars e.g (DrivAer) for my thesis with OpenFOAM v1812.

On this thread

How to plot local residuals' field (for each cell) ? OF 5.x

I found that it is possible to view the local residuals (p Ux Uy Uz ..) for each cell in Paraview, and it works perfect for p but unfortunatly not for U , k, and Epsilon.

The feature is also described here:

https://www.openfoam.com/releases/op...esidual-fields

To use the utility I added the residualFieldDict to the systems Folder. It contains the following
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1812                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/


residualsField
{
    type            residuals;
    libs            ("libutilityFunctionObjects.so");
    writeFields     true;
    writeControl    outputTime;
    fields          (p U k epsilon omega);
}

residuals
{
    type            residuals;
    libs            ("libutilityFunctionObjects.so");
    writeFields     true;
    writeControl    outputTime;
    fields          (p U k epsilon omega);
}
// ************************************************************************* //
As far as I know there is a need to make a include in controlDict as well.

Code:
...
functions
{
    #include "residualFieldDict"
}
So as I already mentioned this works perfectly if you want to have a look at local pressure residual for each cell. It already helped me a lot to get more refinement to the right areas for my problem in Order to achieve lower residuals. But e.g. for Ux Uy and Uz there is no data written to the file.

Here you can see the diffrence between the created files in my folder for 3000 Iteration.

initialResidual:p contains a lot of field informaion

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "3000";
    object      initialResidual:p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];


internalField   nonuniform List<scalar> 
364811
(
-4.15537e-09
-9.58299e-10
-8.97218e-09
1.77756e-09
-1.5212e-09
8.05321e-09
-2.7556e-10
-3.48638e-09
-5.27514e-09
3.91361e-09
-6.64565e-10
1.52268e-09
-5.25854e-10
-4.30708e-09
7.58053e-09
...
but if you have a look at initialResidual:Uz the file contains only this without Field information
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "3000";
    object      initialResidual:Uz;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];


internalField   uniform 0;

boundaryField
{
    symmetryWall
    {
        type            symmetry;
    }
    sideWall
    {
        type            zeroGradient;
    }
    inlet
    {
        type            zeroGradient;
    }
    outlet
    {
        type            zeroGradient;
    }
    lowerWall
    {
        type            zeroGradient;
    }
    upperWall
    {
        type            zeroGradient;
    }
    wheel_FL_wheel
    {
        type            zeroGradient;
    }
    body_body_lights_front
    {
        type            zeroGradient;
    }
Is there anybody who can see if I did something wrong setting up this feature?
Would be nice if you can give me related informations to solve this Problem.

Thanks for your help,

Eric
EZByK is offline   Reply With Quote

Old   May 29, 2019, 12:09
Default
  #2
Member
 
Andrea
Join Date: Mar 2018
Posts: 62
Rep Power: 8
Andrea159357 is on a distinguished road
have you solved your problem? i would like to see cell's residual too.
Andrea159357 is offline   Reply With Quote

Old   June 3, 2019, 03:12
Default
  #3
New Member
 
Eric
Join Date: Apr 2019
Location: Zwickau, Saxony, Germany
Posts: 2
Rep Power: 0
EZByK is on a distinguished road
Hi Andrea,

I had no progress on this one so far, but maybe a more advanced user can have a look at this or provide another strategie to get these kind of information.

There are several options:

- I am using the tool in the wrong way
- I did a small typo somewhere
- It is a bug in the tool (but I dont think so)

So as I mentioned before, if you want to have a look at pressure residual it will be fine but not for U k epsilon ...

Did you have the same result Andrea? Would be nice if some can test this on their own calculation and share experience.

Have a nice day!
EZByK is offline   Reply With Quote

Old   October 1, 2019, 14:49
Default
  #4
Member
 
Luca
Join Date: Mar 2011
Location: Italy
Posts: 62
Rep Power: 15
marluc is on a distinguished road
Hi,


I think the reason lies in the solver used for variables other than p, which is usually (and presumably in your case) solved with GAMG. If you solve "U, k, omega, ..." with PBiCGStab or PBiCG than the residual field of every can be stored using solverInfo:


Code:
    residuals
    {
        type            solverInfo;
        libs            ("libutilityFunctionObjects.so");
        writeResidualFields yes;
        writeControl    writeTime;
        fields          (".*");
    }
Best,
Luca
granzer likes this.

Last edited by marluc; October 3, 2019 at 15:01.
marluc is offline   Reply With Quote

Old   June 26, 2020, 06:34
Default
  #5
Senior Member
 
Troy Snyder
Join Date: Jul 2009
Location: Akron, OH
Posts: 219
Rep Power: 18
tas38 is on a distinguished road
I was recently having some difficulty writing out the residual fields (to visualize in paraview), but was unable to do so.


In v1912, the "residuals" utility function object has been replaced by "solverInfo" as mentioned above. However, even with the "writeResidualFields" set to yes/true, the fields were not being written.


The issue appears to be with the choice of linear solver. I could only get the residual fields to be written using GAMG and NOT PBiCG or smoothSolver.



I do not have an explanation as to why the residual fields are only written for GAMG.
granzer and EZByK like this.
tas38 is offline   Reply With Quote

Old   December 24, 2020, 06:25
Default
  #6
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
You can follow the discussions for the fix:

solverInfo functionObject: writeResidualFields only works for pressure and not for other fields
granzer likes this.
HPE is offline   Reply With Quote

Reply

Tags
field, local residual, residual field, residualfielddict, residuals


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
Free surface issues with interDyMFoam for hydroturbine oumnion OpenFOAM Running, Solving & CFD 0 October 6, 2017 14:05
HeatSource BC to the whole region in chtMultiRegionHeater xsa OpenFOAM Running, Solving & CFD 3 November 7, 2016 05:07
Wrong fluctuation of pressure in transient simulation caitao OpenFOAM Running, Solving & CFD 2 March 5, 2015 21:33
SLTS+rhoPisoFoam: what is rDeltaT??? nileshjrane OpenFOAM Running, Solving & CFD 4 February 25, 2013 04:13
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03


All times are GMT -4. The time now is 08:33.