|
[Sponsors] |
October 1, 2010, 08:04 |
Write cell residual value in the solution?
|
#1 |
Senior Member
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 153
Rep Power: 17 |
Hi all,
with respect to other commercial cfd codes, I miss the possibility to plot the cell residual value (Ux, Uy, p, k, epsilon) in the same way as velocity or pressure and so, detect mesh problems or computational problem in the fluid domain...... Does anyone know if there is this option with openfoam or how to implement it into the code? Thanks in advance |
|
October 1, 2010, 08:31 |
|
#2 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
Say you have a scalar transport equation
Code:
fvScalarMatrix aField ( fvm::ddt(aField) + fvm::div(phi, aField) ); eqnResidual = aField.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual);
__________________
Laurence R. McGlashan :: Website |
|
October 1, 2010, 12:33 |
|
#3 |
Member
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17 |
Hi,
I'm also interested in computing the residual, since I need it for a low-dimensional model via POD modes. Do you know what residual() in Foam::fvMatrix actually computes? I would like to compute the residual (the spatial part of the mom. eq. in rhoPisoFoam) for every cell. However, as a check I tried but I can't get the complete momentum equation to be fulfilled!? Tried the following below. Any idea of what could be wrong? 1) The following two equals, UEqn1Residual == UEqn_Expl_Residual , i.e the .residual() should be divided by the cell volume! And the terms can be computed explicitly, see computations below. (Have also computed the transient term with fvc and fvm which gave the same results!) fvVectorMatrix UEqn1 ( fvm::div(phi, U) + turbulence->divDevRhoReff(U) + fvc::grad(p) ); vectorField UEqn1Residual(UEqn1.residual()); FOR EVERY CELL: volVectorField UEqn1_Residual(UEqn1_Residual[cellI] = UEqn3Residual[cellI]/mesh.V()[cellI]); volVectorField UEqn_Expl_Residual( fvc::div(phi, U) - muEff*fvc::laplacian(U) - muEff*fvc::div(dev2(fvc::grad(U)().T())) + fvc::grad(p)); 2) I've computed the transient term as a volField (fvc::ddt(rho, U)) and the spatial terms as a fvMatrix separately. To check that the momentum eq. is fulfilled I added the transient term with the residual of the spatial terms divided by the cell volume. And the results are far from zero!!!? Thanks All the Best /NW |
|
October 4, 2010, 05:18 |
|
#4 |
Senior Member
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 153
Rep Power: 17 |
Sorry but I do not understand what I have to do. I have not handed on openfoam code so I have no idea.
What I want is to plot with paraView or Tecplot ( with foamToTecplot) the cell residual value ( pressure or Ux, Uy, Uz) but I do not Know what part of the code (files ) I have to modify to obtain this. Could you explain slowly what I have to do it? Please. I will put my best. PD: I am running simpleFoam. OF 1.6.x |
|
October 4, 2010, 05:37 |
|
#5 |
Member
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17 |
I'm myself are trying to get the residuals and my reply to your thread is just another question to why I'm not getting the result I'm expecting.
However, to answer your question you can look at the code in the following thread, http://www.cfd-online.com/Forums/ope...residuals.html Regards /NW |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
transsonic nozzle with rhoSimpleFoam | Unseen | OpenFOAM Running, Solving & CFD | 8 | July 1, 2022 06:54 |
icoLagrangianFoam OF1.6 myNewParticleSolver | heavy_user | OpenFOAM | 23 | June 2, 2020 02:18 |
TwoPhaseEulerFoam and Boundary conditions | raagh77 | OpenFOAM Running, Solving & CFD | 99 | February 6, 2018 18:31 |
Error log | vw.cfd | OpenFOAM | 6 | August 7, 2009 05:44 |
Problem with jet flow | braennstroem | OpenFOAM Running, Solving & CFD | 16 | May 15, 2006 02:23 |