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

Manually change boundary conditions during runs

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 24, 2016, 08:47
Default Manually change boundary conditions during runs
  #1
Member
 
Ruggiero Guida
Join Date: Apr 2013
Location: World
Posts: 46
Rep Power: 12
Rojj is on a distinguished road
Hi,

I am running a few cases based on the incompressible/simpleFoam/turbineSiting tutorial.

I need to run the simulation for several wind speed and same direction. The approach I am using is the following:

1 - Set Uref (reference velocity) to my first windspeed
2 - Run until convergence
3 - Change Uref to the next windspeed
4 - Run until convergence
5 - .....

The idea is that convergence should be faster for windspeeds after the first as I start from a flow that is already developed.

The issue I am having is that when I replace the Uref nothing seems to change. It seems that the first boundary condition is still being used and I have verified this by looking at the results in Paraview.

I am sure I am doing something wrong, but can't understand what.

Any suggestion? Thanks
Rojj is offline   Reply With Quote

Old   March 25, 2016, 04:01
Default
  #2
Senior Member
 
Alex
Join Date: Jan 2014
Posts: 126
Rep Power: 12
Kina is on a distinguished road
Well, the problem is the results folder structure in OF. If you start your calculation, OF uses the U data given in the /0 folder. When OF writes out the results, it creates a separate folder /1000 (for example) with the intermediate field value results of the calculation. If you now continue the calculation, OF will use this data to calculate the solution - still the same low velocity.
In short: you can't use your solution of the 5m/s calculation to speed up the 10m/s calculation. What you can do: change the line in controlDict from:
Code:
startFrom       latestTime;
to
Code:
startFrom       startTime;
This way, OF will use the /0 data (that you can modify during the runs) for each new simulation.

Cheers,
Alex
Kina is offline   Reply With Quote

Old   March 26, 2016, 06:49
Default
  #3
Member
 
Ruggiero Guida
Join Date: Apr 2013
Location: World
Posts: 46
Rep Power: 12
Rojj is on a distinguished road
Thanks Alex.

Of course this means that the solution will be reinitialised?

Cheers
Rojj is offline   Reply With Quote

Old   March 26, 2016, 11:51
Default
  #4
Senior Member
 
Alex
Join Date: Jan 2014
Posts: 126
Rep Power: 12
Kina is on a distinguished road
Hi Ruggiero,

I guess you will have to start every calculation of yours from the initial conditions. I'd choose the following way:
- create a sample folder with all conditions set
- make x copies (for x number of runs) of the folder and name them folder1,folder2 etc. (for example)
- write a bash script that changes the directories in a loop and starts the calculation with potentialFoam / decompose / start.

This way you can leave the computer alone for some days and eventually just read out the results.
Your first idea, initialize higher velocity results with converged lower velocity solutions isn't gonna work as OpenFOAM then reads the lower velocity U field and tries to converge to this velocity instead of reading the new values.

Cheers
Alex
Kina is offline   Reply With Quote

Old   March 26, 2016, 17:22
Default
  #5
Member
 
Ruggiero Guida
Join Date: Apr 2013
Location: World
Posts: 46
Rep Power: 12
Rojj is on a distinguished road
Thanks Kina for your advice.
Rojj is offline   Reply With Quote

Old   August 4, 2017, 22:33
Default
  #6
Member
 
Luis Eduardo
Join Date: Jan 2011
Posts: 85
Rep Power: 15
lebc is on a distinguished road
Hi Ruggiero,

I want to do exactly the same thing you want. Did you solve the problem, or just did what Alex suggested?

One way to do it is editing the U and other files from your latest time step, but there is one problem here... It probably is a huge file, and it would take a long time to edit it, so for me it seems unfeasible.

If you found another way please tell me!

Best Regards,
Luis
lebc is offline   Reply With Quote

Old   August 5, 2017, 05:24
Default
  #7
Member
 
Ruggiero Guida
Join Date: Apr 2013
Location: World
Posts: 46
Rep Power: 12
Rojj is on a distinguished road
Hi Luis,

I ended up changing my whole workflow so I didn't have to run multiple simulations.

The last thing I was looking at though, was mapfields.

If you make it work, I would be very curious to know how you did it :-)
Rojj is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
non reflective boundary conditions for incompresible flow Pascal_doran OpenFOAM Programming & Development 16 August 25, 2015 05:35
Problem with SIMPLEC-like finite volume channel flow boundary conditions ghobold Main CFD Forum 3 June 15, 2015 11:14
Difficulty In Setting Boundary Conditions Moinul Haque CFX 4 November 25, 2014 17:30
Setting rotating frame of referece. RPFigueiredo CFX 3 October 28, 2014 04:59
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44


All times are GMT -4. The time now is 21:47.