|
[Sponsors] |
Restart a dynamic refined simulation from a different time-step |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 27, 2017, 12:08 |
Restart a dynamic refined simulation from a different time-step
|
#1 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17 |
Hi All,
Is there a way to restart a simulation with dynamic mesh refinement (interDyMFoam) from a time different from zero, and prevent openFoam from refining again a mesh that has already been refined in the previous steps? If a simply restart the simulation from a time different from the 0-time, openfoam takes the already refined mesh as the "base" mesh and refines again. i would like to avoid this. I though about using mapField utility to map the "refined" fields at a certain time back on the base mesh (not refined) and restart the simulation from there but i was wondering if there is a quicker way to do that. best, Andrea |
|
June 27, 2017, 12:35 |
|
#2 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
I can, from the top of my head, come up with two tactics. Not sure whether they will work:
|
|
June 27, 2017, 13:02 |
|
#3 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17 |
Kevin,
thanks for you answer. However what i want is to keep using the dynamic mesh refinement and this will not be case with your 2 criteria. The mesh would remain static and equal to the mesh of the last saved time-step. I would like openfoam to "mark" the mesh as "already refined" in the first time-step and then continue the simulation by adding and removing cells with the same criteria used before. not sure if it is possible... andrea |
|
June 28, 2017, 07:17 |
|
#4 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
So you want to freeze the refinement level, such that cells that were already refined to level 2 are reset to level 0, such that they can again be refined to level 2 (which corresponds to level 4 relative to your initial mesh)?
I don't know how to do that / whether it is possible at all, but you could try to open the refinementLevel file in your time directory and nullify all values. |
|
June 30, 2017, 12:16 |
|
#5 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 17 |
I do not want to freeze the refinement level, i just want openfoam to identify already refined cells from not-refined cells when i restart a simulation and i ve just realized that this is specified in "cellLevel" file. My maximum level of refinement is 2, which means that if the cellLevel for a specific cell is 2, OF must not refine. However when i restarted the simulation from the last saved time it looks like OF does not read the refinement level and refines again cells that have been already refined before, giving a global maximum refinement level of 4 instead of 2.
Anyway, after playing a bit i solved the problem. If i don't reconstruct the mesh of the last saved time of the first simulation and i simply restart from latestTime everything runs just fine. OF correctly identifies already refined cells from not-refined. However if i reconstruct the last saved time using Code:
reconstructParMesh -latestTime -mergeTol 1e-6 reconstructPar -latestTime I do not know why this is happening but it might be related to this line i got in the log file: Code:
Detected 122168 cells that are protected from refinement. Writing these to cellSet protectedCells. Best, Andrea |
|
December 21, 2017, 21:40 |
|
#6 | |
New Member
Oliver Pasqual
Join Date: Nov 2016
Posts: 5
Rep Power: 10 |
Quote:
Dear Andrea, I got the same problem as you. It seems that the OF does not change the mesh after decoposing the mesh reconstructed. So, do you have any progress in this? Thanks. O.P |
||
November 29, 2018, 09:28 |
|
#7 |
Member
Join Date: May 2016
Posts: 39
Rep Power: 10 |
Hi Andrea_85,
option that you talk about is possible to achieve and I use it to redistribute the cells more evenly during the simulation. I have a highly transient simulation that eventually comes to steady state, so the number of cells changes drastically during the simulation. I actually stop the code few times to redistribute the cells and run in forward (can be done with simple bash code). What you already figured out is that which cells are refined is written in cellLevel file. So what you need to do is to make sure that after you reconstruct the mesh this files are in your times steps in polymesh folder. By running in sequence reconstructParMesh and then raconstructPar (makes your cellLevel & pointLevel files) you should be able to get this. I usually copy the last time step, constant and system folders in a new subfolder, then I remove polyMesh from constant and replace it with the new polyMesh from the last time step. Only thing left is decomposition via: decomposePar -constant and running the case again. Most importantly, for me this works with version OF41 but not with OF301. So do some testing with your versions. Hope this helps, Cheers |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field | lakeat | OpenFOAM Community Contributions | 58 | December 23, 2021 03:36 |
p_rgh initial residual no change with different settings | manuc | OpenFOAM Running, Solving & CFD | 3 | June 26, 2018 16:53 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 01:01 |
mixerVesselAMI2D's mass is not balancing | sharonyue | OpenFOAM Running, Solving & CFD | 6 | June 10, 2013 10:34 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |