CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How to change settings codewise (https://www.cfd-online.com/Forums/openfoam-programming-development/143918-how-change-settings-codewise.html)

pi06jl6 November 5, 2014 13:21

How to change settings codewise
 
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 .

kmooney November 6, 2014 00:59

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

pi06jl6 November 6, 2014 03:07

Quote:

Originally Posted by kmooney (Post 517608)
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 November 10, 2014 07:14

Quote:

Originally Posted by kmooney (Post 517608)
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.


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