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

Solve a non-differential equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 14, 2016, 12:17
Default Solve a non-differential equation
  #1
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hello

I have to solve an equation to get the turbulent Prandtl number in my case, where I have something like:

f(Pr_t)=0

where f is a complex formula, so I see a bit hard to get an analytical solution to get the turbulent Prandtl number.

I am thinking to solve it by iterations (Newton method), but I would like to know if someone has alredy solved something similar in an equation environment.

The problem of the Newton method is I have to get the turbulent Prandtl number in each cell (is a volScalarField).

I will comment my advances
agustinvo is offline   Reply With Quote

Old   January 14, 2016, 13:10
Default
  #2
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
tomislav_maric is on a distinguished road
There are ODE solvers available that you can use for that purpose. Check out applications/test/ODE. You can compile the test with wmake and execute it like this:

Code:
Test-ODE Euler
Or like this:

Code:
Test-ODE whaaat
to get the list of available solvers. The Euler solver implements the Newton root finding method. If you open Test-ODE.C, you can see how to assemble an ODE system. In your case, you will not have 4 but one equation. And you can compute the derivatives.

If you want to solve this for a field, my guess is that you need to perform root finding on a per-cell basis. That could be quite costly, depending on the function graph - for example if it has diminishing gradients, or there is no way to find a good starting point.
__________________
When asking a question, prepare a SSCCE.
tomislav_maric is offline   Reply With Quote

Old   January 15, 2016, 12:23
Default
  #3
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hello

thanks for your answer, tomislav_maric. I have checked the code and I have implemented the equation, but as you said and I supposed, it has a huge computational cost.

I will check if there are other possibilites.

Thanks for your help!
agustinvo is offline   Reply With Quote

Old   January 18, 2016, 10:22
Default
  #4
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 19
chriss85 will become famous soon enough
It might be faster if you use the previous result as a starting point for the next iteration.
chriss85 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
Setting the height of the stream in the free channel kevinmccartin CFX 12 October 13, 2022 22:43
solve the continuity equation openfoammaofnepo OpenFOAM 0 May 19, 2013 07:12
Descretization of momentum equation to solve Navier stokes equation by finite volume manishsathe14 Main CFD Forum 2 December 30, 2012 23:25
How to solve this ordinary differentiate equation ztdep Main CFD Forum 3 September 13, 2006 00:21
solving a differential equation with NEWTON.... myway Main CFD Forum 0 May 15, 2006 03:05


All times are GMT -4. The time now is 07:19.