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

Implementing TVD-RK3 method in rhoCentralFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By spatz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2017, 05:03
Default Implementing TVD-RK3 method in rhoCentralFoam
  #1
New Member
 
Vachan Potluri
Join Date: Jul 2017
Posts: 29
Rep Power: 8
vachan is on a distinguished road
Hello,

I am trying to modify rhoCentralFoam to implement TVD-RK3 time stepping by solving the governing equations thrice with appropriate variables. I have named my solver "rhoCentralFoam1".

The solver got compiled without any errors but I am getting the following error when using the solver for a shockTube case.
Code:
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::tmp<Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::operator/<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:?
#4  ? at ??:?
#5  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6  ? at ??:?
Floating point exception (core dumped)
There is NO error if rhoCentralFoam is used for the same case.

I have attached the solver source file and new header files that I have used in my solver. runLog.txt is the log generated when shockTube case is run.

Can anyone please help me in this regard? I am new to this forum so sorry if my post doesn't give enough information. I am using OpenFOAM 4.1

Thanks, Vachan
Attached Files
File Type: zip solver_and_files.zip (6.1 KB, 41 views)

Last edited by vachan; July 31, 2017 at 00:51.
vachan is offline   Reply With Quote

Old   August 3, 2017, 05:41
Default
  #2
New Member
 
Vachan Potluri
Join Date: Jul 2017
Posts: 29
Rep Power: 8
vachan is on a distinguished road
Figured out. (1/3) and (2/3) were taken as zeros by openfoam. Made them (1.0/3.0) and (2.0/3.0).
vachan is offline   Reply With Quote

Old   December 8, 2017, 11:23
Default
  #3
Member
 
Reza khodadadi
Join Date: Apr 2011
Location: https://t.me/pump_upp
Posts: 32
Rep Power: 15
reza_65 is on a distinguished road
Send a message via ICQ to reza_65 Send a message via AIM to reza_65 Send a message via Yahoo to reza_65
Quote:
Originally Posted by vachan View Post
Figured out. (1/3) and (2/3) were taken as zeros by openfoam. Made them (1.0/3.0) and (2.0/3.0).
I am wondering are you sure about this (1/3 is zero in OpenFOAM!)? Did you check with using debug version?
Actually sometimes I face some problem regarding to precisions as well.
It would be interesting if you could share the final version of this solver.


Thanks,
Reza

Last edited by reza_65; December 8, 2017 at 11:27. Reason: adding some stuff
reza_65 is offline   Reply With Quote

Old   December 8, 2017, 21:09
Default
  #4
New Member
 
Vachan Potluri
Join Date: Jul 2017
Posts: 29
Rep Power: 8
vachan is on a distinguished road
Hi Reza,

Thanks for the reply. Sorry, I didn't check it using the debug version but making that one change alone made the code run fine. The code I had posted earlier on this thread is an older version and I have made more modifications to it. Presently, I use 0.33333334 and 0.66666667 instead of 1.0/3.0 and 2.0/3.0 to reduce run time. The code works fine even with these.

Thanks, Vachan
vachan is offline   Reply With Quote

Old   November 30, 2019, 23:09
Default Shouldn't we all have TVD-RK3 for rhoCentralFoam?
  #5
New Member
 
Jeff Kollasch
Join Date: Dec 2011
Location: Ames, Iowa
Posts: 5
Rep Power: 14
spatz is on a distinguished road
To my knowledge TVD-RK3 (Shu, Osher, 1988 https://ntrs.nasa.gov/archive/nasa/c...9880014833.pdf) is an excellent explicit time integration choice; better than Euler explicit for aeroacoustics by a fair margin. I've implemented it a few times in simple little NS and MHD codes and never recall it being more than a dozen lines of code. I am wondering if someone more experienced in OpenFOAM and rhoCentralFoam in particular knows why higher-order RK schemes aren't offered in the main branch of OpenFOAM -- I have just download version 7 and just see the following in the ddtSchemes source folder:


backwardDdtScheme CoEulerDdtScheme ddtScheme localEulerDdtScheme steadyStateDdtScheme
boundedDdtScheme CrankNicolsonDdtScheme EulerDdtScheme SLTSDdtScheme



I am not meaning to complain. If it is for lack of man-power, I should be happy to help, and it seems like the individual who founded this thread (and perhaps many others) have already made their own explicit RK time integrators.
emjay likes this.
spatz is offline   Reply With Quote

Old   December 23, 2019, 02:35
Default
  #6
New Member
 
Vachan Potluri
Join Date: Jul 2017
Posts: 29
Rep Power: 8
vachan is on a distinguished road
Hi Jeff,

Quote:
I am wondering if someone more experienced in OpenFOAM and rhoCentralFoam in particular knows why higher-order RK schemes aren't offered in the main branch of OpenFOAM
For compressible flows, inviscid flux scheme is implemented in a solver. Since TVD RK3 requires calculation of residual multiple times, each time using the flux scheme, it is not possible to decouple the time integration scheme. The time stepping scheme, by itself, doesn't know how to compute the residuals in solvers like rhoCentralFoam. Had the OpenFOAM user interface for inviscid flux scheme also been managed by a dictionary entry, what you proposed would then have been possible with the time integration scheme internally using the flux scheme.
vachan 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
Code for most powerfull FDV Method D.S.Nasan Main CFD Forum 6 September 4, 2008 02:08
Help about the preconditioner in gmres method Dan Gao Main CFD Forum 3 July 5, 2008 01:18
Info on method of lines approach charlie ryan Main CFD Forum 2 August 9, 2007 11:06
TVD student Main CFD Forum 6 September 9, 2002 09:19
level set method with TVD scheme? zhanglei Main CFD Forum 1 April 25, 2000 14:01


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