|
[Sponsors] |
February 15, 2016, 21:19 |
Probing Residuals at specific points
|
#1 |
Member
DB
Join Date: Apr 2011
Posts: 87
Rep Power: 15 |
Hi All,
I want to monitor residuals at specific points in the domain. I have checked the residual function objects which gives max initial residuals in the entire domain. I have checked probes as well which writes various fields at various probe locations. I have found no examples of writing residuals at specific points. Can someone enlighten me of any functionality present in OpenFOAM which would help me get residuals at specific points in the domain, or if someone has an idea of how to change the source code for the same purpose. Thanks,
__________________
-D.B |
|
July 21, 2016, 10:20 |
|
#2 |
New Member
Join Date: Jun 2016
Posts: 9
Rep Power: 10 |
Hi D. B.! I'm looking for exactly the same – have you found a solution in the meantime?
|
|
August 30, 2016, 12:50 |
|
#3 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
A long time ago, I submitted a patch for something related to this:
http://bugs.openfoam.org/view.php?id=270 Perhaps this is a starting point: You can access the residual field of the solver object. Also the normalization constant should be accessible via the object registry. So you have to modify the solver and store the residuals as field at each (to be saved) time step. In createFields.H of your solver, you have to add fields for the residuals, e.g.: Code:
volVectorField uResidual ( IOobject ( "uResidual", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedVector("zero", dimensionSet(0,0,-1,0,0,0,0), vector(0.0, 0.0, 0.0)) ); volScalarField uxRes ( IOobject ( "uxRes", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("zero", dimensionSet(1,-2,-2,0,0,0,0), 0.0) ); volScalarField uyRes ( IOobject ( "uyRes", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("zero", dimensionSet(1,-2,-2,0,0,0,0), 0.0) ); volScalarField uzRes ( IOobject ( "uzRes", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("zero", dimensionSet(1,-2,-2,0,0,0,0), 0.0) ); volScalarField pResidual ( IOobject ( "pResidual", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("zero", dimensionSet(0,0,-1,0,0,0,0), 0.0) ); Code:
pResidual.internalField() = p_rghEqn.residual(); Code:
uResidual.internalField() = UEqnRes.residual(); uxRes.internalField() = mag(uResidual.component(0)); uyRes.internalField() = mag(uResidual.component(1)); uzRes.internalField() = mag(uResidual.component(2)); |
|
Tags |
openfoam;, probing, residuals |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting the height of the stream in the free channel | kevinmccartin | CFX | 12 | October 13, 2022 22:43 |
Simulation of a single bubble with a VOF-method | Suzzn | CFX | 21 | January 29, 2018 01:58 |
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion | faizan_habib7 | CFX | 4 | February 1, 2016 18:00 |
Compression stoke is giving higher pressure than calculated | nickjuana | CFX | 62 | May 19, 2015 14:32 |
judging convergence through residuals | MachZero | Main CFD Forum | 7 | December 25, 2012 13:18 |