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

Transfer number from controlDict/fvSchemes to own solver

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By tomislav_maric

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2015, 13:17
Question Transfer number from controlDict/fvSchemes to own solver
  #1
New Member
 
Justin Wiegmann
Join Date: Aug 2015
Posts: 20
Rep Power: 10
SirIsaac90 is on a distinguished road
Hello everyone!

I wrote a new solver for incompressible flows with Runge-Kutta methods for time discretization implemented.
My problem is that I want to write in fvSchemes or controlDict a number which stands for a specific Runge-Kutta method. This number shall be transferred to my solver. Inside the solver with this number the specific Runge-Kutta method is chosen and the computation with this Runge-Kutta method starts.

Can anyone help me how to do that? How do I have to declare the variable?
I would be very thankful for any advices!


Regards

Justin
SirIsaac90 is offline   Reply With Quote

Old   December 22, 2015, 05:36
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
Quote:
Originally Posted by SirIsaac90 View Post
Hello everyone!

I wrote a new solver for incompressible flows with Runge-Kutta methods for time discretization implemented.
My problem is that I want to write in fvSchemes or controlDict a number which stands for a specific Runge-Kutta method. ...
So basically you want to select a Runge-Kutta (RK) method based on an entry in the dictionary file. Here are a few pointers

  1. Encapsulate the RK methods into classes if you already haven't done that. You don't have to follow the design of ddtSchemes in OpenFOAM, you can start by implementing your own classes as the first try.
  2. Identify the different RK methods with names (strings, words) and not numbers, since they are identified with different names in the "real world".
  3. Use the Run-time Type Selection mechanism to make your RK method classes run-time selectable.
    1. Implement a constructor in the RK class that takes a dictionary constructor.
    2. Add your RK method dictionary as a sub-dictionary of any dictionary file, it can be controlDict, fvSchemes, whereve you think it should go.
    3. Select the scheme like in the tutorial above, by passing the sub-dict as the argument to the New selector.
kmooney likes this.
__________________
When asking a question, prepare a SSCCE.
tomislav_maric is offline   Reply With Quote

Old   January 9, 2016, 12:11
Default
  #3
New Member
 
Justin Wiegmann
Join Date: Aug 2015
Posts: 20
Rep Power: 10
SirIsaac90 is on a distinguished road
Hi!

This is exactly the thing I want to do.

I will try that out these days. Thank you very much !!

Best regards!
SirIsaac90 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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 09:42
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 00:01
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 15:03
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15


All times are GMT -4. The time now is 22:53.