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

Get initialResidual of each space direction

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2015, 09:47
Default Get initialResidual of each space direction
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I have a question about the initial residuals for the questions in the x, y and z direction. I can make a scalar where i get the lowest initial residuals of x,y and z like:
Code:
scalar initResidual = UEqn.solve().initialResidual();
Does anybody know if its possible to access x, y and z like:
Code:
scalar initResidual_x = UEqn.solve().initialResidual().x();
scalar initResidual_y = UEqn.solve().initialResidual().y();
scalar initResidual_z = UEqn.solve().initialResidual().z();
Via Doxygen I did not find a call function that return the value I need. I need it because my stress solver (2d-rotational symmetric - wedge) is not stopping because the wedge side's are fluctuating and do not fall down.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 27, 2015, 08:17
Default component(initialResidual, xyz)
  #2
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18
fabian_roesler is on a distinguished road
Hi Tobi

have a look into
/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C.

This is the part of OpenFOAM where all the solver outputs come from. Here they use component(initialResidual, xyz). May be this is what you're looking for.

Code:
for(direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
{
    if (pTraits<Type>::nComponents == 1)
    {
        os << solverName_ << ": Solving for " << fieldName_;
    }
    else
    {
        os << solverName_ << ": Solving for "
           << word(fieldName_ + pTraits<Type>::componentNames[cmpt]);
    }
    if (singular_[cmpt])
    {
        os << ": solution singularity" << endl;
    }
    else
    {
        os << ", Initial residual = " << component(initialResidual_, cmpt)
           << ", Final residual = " << component(finalResidual_, cmpt)
           << ", No Iterations " << noIterations_
           << endl;
    }
 }
Cheers


Fabian
fabian_roesler is offline   Reply With Quote

Old   August 27, 2015, 09:13
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear Fabian, thanks for the hint. Is exactly need component(finalResidual_, clot). But how to access to that value out of that function? I am not at my computer at the moment but will check it later.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 5, 2016, 08:17
Default
  #4
Member
 
Kumar
Join Date: Jun 2013
Posts: 47
Rep Power: 12
kishpishar is on a distinguished road
Hi Tobi,

Have you found out a way to extract the individual components of the initialResidual()? If you make scalar initRes = UEqn.solve().initialResidual()
I think you get the initial residual of the last equation solved. I need this for a transient solver I am making. Thanks,

Kumar
kishpishar 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
ERROR: Flow direction on the boundaries must not be tangential to the boundary. turbomax CFX 2 August 6, 2015 11:05
Flow Direction: normal to boundary!!! Atit CFX 1 August 2, 2015 13:42
Changing inflow velocity direction deteriorates lift and drag ziggo FLUENT 3 July 24, 2013 08:39
How to model the NR eqns in a domain with empty space Vasilis Main CFD Forum 1 April 14, 2009 04:35
Fatal error error writing to tmp No space left on device maka OpenFOAM Installation 2 April 3, 2006 08:48


All times are GMT -4. The time now is 15:59.