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

How to change settings codewise

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 5, 2014, 13:21
Default How to change settings codewise
  #1
Member
 
Johan Lorentzon
Join Date: Mar 2009
Location: Lunds University, Sweden
Posts: 78
Rep Power: 23
pi06jl6 will become famous soon enough
I would like to know how to change settings codewise rather than using the current IO functionality, like changing the temporal discretization rather than monitor the log file and do this manually. I would appreciate if someone could paste a snippet code example or point me to a relevant post, tried the search engine but failed utterly .
pi06jl6 is offline   Reply With Quote

Old   November 6, 2014, 00:59
Default
  #2
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
kmooney is on a distinguished road
There is an example of a hard-coded temporal discretization scheme selection in the interFoam solver here:

/OpenFOAM-2.3.x/applications/solvers/multiphase/interFoam/alphaEqn.H

That might give you a few hints as to how to go about what you're after.

Cheers,
Kyle
kmooney is offline   Reply With Quote

Old   November 6, 2014, 03:07
Thumbs up
  #3
Member
 
Johan Lorentzon
Join Date: Mar 2009
Location: Lunds University, Sweden
Posts: 78
Rep Power: 23
pi06jl6 will become famous soon enough
Quote:
Originally Posted by kmooney View Post
There is an example of a hard-coded temporal discretization scheme selection in the interFoam solver here:

/OpenFOAM-2.3.x/applications/solvers/multiphase/interFoam/alphaEqn.H

That might give you a few hints as to how to go about what you're after.

Cheers,
Kyle
Thank you Kyle!
pi06jl6 is offline   Reply With Quote

Old   November 10, 2014, 07:14
Default
  #4
Member
 
Johan Lorentzon
Join Date: Mar 2009
Location: Lunds University, Sweden
Posts: 78
Rep Power: 23
pi06jl6 will become famous soon enough
Quote:
Originally Posted by kmooney View Post
There is an example of a hard-coded temporal discretization scheme selection in the interFoam solver here:

/OpenFOAM-2.3.x/applications/solvers/multiphase/interFoam/alphaEqn.H

That might give you a few hints as to how to go about what you're after.

Cheers,
Kyle
Unfortunately this doesnt help me, but it was a step in the right direction, anyone that could help me more specific with switch between Euler/backward?

Edit: One simple solution that I have implemented is by using system call. Then supply it with a string with the command : "sed -i s/XXX/YYY/g filename". I can of course augment it with much more complex instructions, but this is the most simple, then save this as .H file and include it whenever u wanna change parameter.

Last edited by pi06jl6; November 19, 2014 at 13:18. Reason: Complement with my own solution
pi06jl6 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
Possible to change default settings? pakk FLUENT 1 January 15, 2021 01:23
Thermal phase change model Piti CFX 1 January 14, 2021 10:03
[ICEM] How do I change the background settings to default? ansvad ANSYS Meshing & Geometry 3 January 14, 2020 04:44
Radiation interface hinca CFX 15 January 26, 2014 17:11
How to change molecular weight of a species in pdf-mixture Jenny_W FLUENT 0 November 3, 2012 16:49


All times are GMT -4. The time now is 10:30.