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

How to restart simulation using results from other solver

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

Like Tree1Likes
  • 1 Post By Flowkersma

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2016, 17:38
Default How to restart simulation using results from other solver
  #1
Member
 
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 10
sahmed is on a distinguished road
Dear all
I have a question, which might be helpful for others as well. Could anyone please tell me how can I restart a simulation in a solver using the results from a different solver. I know I can do that using latestTime option of the controlDict, but that is if I want to restart using the same solver. But if I want to use the restarting criteria (results) from another solver, how can I do that.

For example, suppose pisoFoam gives me a simulation results and I want to use those results as my starting criteria for simulation using another solver- icoFoam (I am just making up solver names).

Any of your helpful suggestion or comment will be highly appreciated and helpful for the community.
Thanks

~Sheikh Ahmed
sahmed is offline   Reply With Quote

Old   September 21, 2016, 01:27
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
Flowkersma is on a distinguished road
Dear Sheikh Ahmed,

If you are using the same mesh with the new simulation, you can simply copy the latest time step folder to the new case folder where you are using the new solver. You may also rename the folder to 0. If you are not using the same mesh, then you can use mapFields utility to interpolate the solution from the old case to the new case.

Best,
Mikko
Flowkersma is offline   Reply With Quote

Old   September 21, 2016, 04:36
Default
  #3
Member
 
Join Date: Feb 2015
Posts: 39
Rep Power: 11
HenningW is on a distinguished road
Hi,

you can work with flowkersma's solution. But -latestTime should work as well, I use it all the time.

Quote:
I know I can do that using latestTime option of the controlDict, but that is if I want to restart using the same solver.
Do you get an error, when you try a different solver? Probably you need to add additional boundary conditions? But that would apply for the copied files as well.

As a third option you could also run
Code:
mapFields -parallelSource -parallelTarget -sourceTime latestTime  /folder/of/your/old/simulation
(Dont forget to create a mapDieldsDict)
HenningW is offline   Reply With Quote

Old   September 21, 2016, 16:50
Default
  #4
Member
 
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 10
sahmed is on a distinguished road
Thank you very much Flowkersma and Mikko for your prompt replies. According to your suggestions, I copied the U file of the latest time to the new solver's time folder and could run without error. I couldnt copy the whole 'time folder' since my older solver solves only P and U, whereas my new solver solves P, T, U etc. Also, the units of P were different (P/rho in pisoFoam and P in laminarSMOKE) and thats why I couldnt copy P as well.
Any idea or suggestion regarding the process I am using?

I dont need the mapFieldsDict right now since I am using identical mesh sizes, but I have to use that for my future runs for sure.

Thanks once again and please share if you have any new thoughts.

~SFA
sahmed is offline   Reply With Quote

Old   September 21, 2016, 16:51
Default
  #5
Member
 
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 10
sahmed is on a distinguished road
I am sorry, thanks to Mikko and HenningW
sahmed is offline   Reply With Quote

Old   September 22, 2016, 00:51
Default
  #6
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
Flowkersma is on a distinguished road
I think that is fine what you are doing but note that the meshes have to be exactly same between the two cases. Probably, that is the case for you because you did not get any errors regarding that. If you want to use the P from incompressible case, you can change the unit and calculate the absolute pressure for compressible solver with foamCalc.
HenningW likes this.
Flowkersma is offline   Reply With Quote

Old   September 22, 2016, 11:57
Default
  #7
Member
 
Sheikh Ahmed
Join Date: Dec 2015
Location: South Carolina, USA
Posts: 88
Rep Power: 10
sahmed is on a distinguished road
Thanks Mikko. Could you tell me the foamCalc command to convert phi to p as you mentioned.
sahmed is offline   Reply With Quote

Old   September 23, 2016, 12:25
Default
  #8
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
Flowkersma is on a distinguished road
You probably mean how to convert the pressure (p/rho) from the incompressible solver to the compressible solver. If that's the case, the syntax for foamCalc should be something like
Code:
foamCalc scalarMult p -value 1.2 -resultName p
foamCalc addSubtract p add -value 100000 -resultName p
where 1.2 is the density and 100000 is the atmospheric pressure (i.e. if you were using pressure=0 at the outlet for incompressible solver). Finally, you'll have to modify the dimension line in p file from
Code:
dimensions      [0 2 -2 0 0 0 0];
to
Code:
dimensions      [1 -1 -2 0 0 0 0];
In OF4 you should use postProcess utility but I don't know how it works.
Flowkersma is offline   Reply With Quote

Old   July 5, 2019, 06:02
Default
  #9
Senior Member
 
Carlo_P
Join Date: May 2019
Location: Italy
Posts: 176
Rep Power: 7
Carlo_P is on a distinguished road
Hey Flowkersma,
now seems that the foamCalco doen't work, with OpenFOAM 6.


Now one should use postProcess utilities.
Do you have any idea how to convert your string?


Thanks a lot,
Carlo
Carlo_P is offline   Reply With Quote

Reply

Tags
latesttime, restart solution

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
CFX Solver does not write the results file and returns with error code 1 zeeshans CFX 17 November 16, 2023 11:11
fluent divergence for no reason sufjanst FLUENT 2 March 23, 2016 16:08
OF-2.3.x: interPhaseChange(DyM)Foam: simulation restart leads to non-physical fields A_Pete OpenFOAM Bugs 0 August 12, 2015 09:16
Instability in transonic coupled solver simulation MachZero Main CFD Forum 0 February 17, 2015 20:47
interrupt the simulation, check results, continue simulation soulsaver Phoenics 1 June 28, 2013 01:15


All times are GMT -4. The time now is 01:41.