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

OpenFOAM programming to load certain number of case files it-self?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 17, 2016, 13:35
Question OpenFOAM programming to load certain number of case files it-self?
  #1
Member
 
Ash Kotwal
Join Date: Jul 2016
Location: North Dakota, USA
Posts: 92
Blog Entries: 1
Rep Power: 10
Ash Kot is on a distinguished road
User has created one case file which will run for 3000 time-steps, now the problem is finished with use of all time-steps. However, at this time, user wants OpenFOAM software 'itself' to load next .cas file which is made of its own Independent settings from the first one, and run the file with its own settings, get initialized by itself and run for another 3000 time-steps, using specific way of coding, is it possible for OpenFOAM to program like this any type of application, lets say 2phaseEulerFoam, if yes, How to do this?

Kindly show me with some examples, if there is any tutorial with certain set of commands in it, please show me.

I asked same type of question in ANSYS FLUENT forum, but I have more faith on OpenFOAM, because its more robust, although coding makes it little bit difficult

Thank You,

Regards,

Ash Kot,
University of North Dakota, USA
Ash Kot is offline   Reply With Quote

Old   October 18, 2016, 04:49
Default
  #2
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hi,

could you be more explicit? If you want to run different cases in different folders, what you can do is to create a terminal script, where you change your path, and you run other case.
agustinvo is offline   Reply With Quote

Old   October 19, 2016, 02:59
Default
  #3
Member
 
Ash Kotwal
Join Date: Jul 2016
Location: North Dakota, USA
Posts: 92
Blog Entries: 1
Rep Power: 10
Ash Kot is on a distinguished road
in fluent, if you have experience with it, we can write journal or Scheme language file (TUI commands), and can load the cases one by another. And even if each case is independent of each other fluent, understand those, and gives proper results.
Also in fluent we can write UDF functions regarding profiles of boundary conditions, based on flow time or time step, for example, changing mass flow rate based on flow time.

is there anything like that in OpenFOAM, if it is, can you direct me to the informational material.
Ash Kot is offline   Reply With Quote

Old   October 19, 2016, 04:39
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Are you at all familiar with Linux and OpenFOAM?
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   October 19, 2016, 05:15
Default
  #5
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hi,
Good Morning.

Why dont you use a simple bash script to call each Simulation one after the other?

Example...:

#/bin/bash

simpleFoam -case <full path to case -1>
simpleFoam -case <full path to case - 2>


etc...etc...

This way, you can simulate one case after the other...

However, the better way to do this would be to use some kind of load balancing System like "HTCondor".. then you can just submit multiple cases to the Queue, and they will be simulated either simultaneously, or one after the other depending on what resources the Computer has available.

Regards,
Philippose
philippose is offline   Reply With Quote

Old   October 19, 2016, 07:32
Default
  #6
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Quote:
Originally Posted by agustinvo View Post
Hi,

could you be more explicit? If you want to run different cases in different folders, what you can do is to create a terminal script, where you change your path, and you run other case.
Quote:
Originally Posted by philippose View Post
Hi,
Good Morning.

Why dont you use a simple bash script to call each Simulation one after the other?

Example...:

#/bin/bash

simpleFoam -case <full path to case -1>
simpleFoam -case <full path to case - 2>


etc...etc...

This way, you can simulate one case after the other...

However, the better way to do this would be to use some kind of load balancing System like "HTCondor".. then you can just submit multiple cases to the Queue, and they will be simulated either simultaneously, or one after the other depending on what resources the Computer has available.

Regards,
Philippose
Yes, this is what I was thinking... I am not an expert in bash, but for sure there are a lot of examples on the internet to do this.

The main difference between Fluent and OpenFOAM about this, is that Fluent uses its own terminal, so you can do as you say (open this case and so on), but OpenFOAM uses the Linux terminal so to use it as you want you need to play with the terminal.

It does not seems a bad idea that HTCondor you talk about, Philippose, specially for parametric studies. I will take a look!
agustinvo is offline   Reply With Quote

Old   November 5, 2016, 06:52
Default
  #7
Senior Member
 
Zeppo's Avatar
 
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22
Zeppo will become famous soon enough
Quote:
Originally Posted by Ash Kot View Post
User has created one case file which will run for 3000 time-steps, now the problem is finished with use of all time-steps. However, at this time, user wants OpenFOAM software 'itself' to load next .cas file which is made of its own Independent settings from the first one, and run the file with its own settings, get initialized by itself and run for another 3000 time-steps, using specific way of coding, is it possible for OpenFOAM to program like this any type of application, lets say 2phaseEulerFoam, if yes, How to do this?
There're even a dedicated function object:
"timeActivatedFileUpdate. Performs a file copy/replacement once a specified time has been reached.
Example usage to update the fvSolution dictionary at various times throughout the calculation:"
Code:
fileUpdate1
{
    type              timeActivatedFileUpdate;
    libs ("libutilityFunctionObjects.so");
    writeControl     timeStep;
    writeInterval    1;
    fileToUpdate      "$FOAM_CASE/system/fvSolution";
    timeVsFile
    (
        (-1 "$FOAM_CASE/system/fvSolution.0")
        (0.10 "$FOAM_CASE/system/fvSolution.10")
        (0.20 "$FOAM_CASE/system/fvSolution.20")
        (0.35 "$FOAM_CASE/system/fvSolution.35")
    );
}
Zeppo is offline   Reply With Quote

Old   February 28, 2017, 04:42
Default
  #8
Member
 
Ash Kotwal
Join Date: Jul 2016
Location: North Dakota, USA
Posts: 92
Blog Entries: 1
Rep Power: 10
Ash Kot is on a distinguished road
Quote:
Originally Posted by akidess View Post
Are you at all familiar with Linux and OpenFOAM?


Not much but trying to leave fluent like proprietary software and trying to get full understanding of open source softwares, like OpenFOAM


Sent from my iPhone using CFD Online Forum mobile app
Ash Kot 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
[ImmersedBoundary] Immersed Boundary Method in OpenFOAM-3.1-ext miladrakhsha OpenFOAM Community Contributions 106 July 3, 2023 11:26
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 06:38
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 10:42
Compressor Simulation using rhoPimpleDyMFoam Jetfire OpenFOAM Running, Solving & CFD 107 December 9, 2014 14:38
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 13:24


All times are GMT -4. The time now is 15:59.