|
[Sponsors] |
change BC during a run but the BC isn't implemented |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 30, 2020, 20:10 |
change a BC during a run
|
#1 |
Senior Member
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 9 |
Hi FOAMers!
A tank partially filled with liquid is being drained in interFoam. After 10 seconds, I would like the drain rate to change. To do this, I run the simulation for 10 seconds, then edit the 0/U BC file, and execute " mpirun -np 16 interFoam -parallel " The issue is the initial boundary condition I specified at the beginning of the run is still being used, as if OpenFOAM does not realize I edited the U file. What command do I need to add? At the beginning of the simulation I run the following Code:
rm -r postProcessing rm -r processor* rm 0/alpha.water rm constant/dynamicMeshDict cp -r ../mesh/constant/polyMesh constant cp dynamicMeshDict_refine constant/dynamicMeshDict setFields decomposePar mpirun -np 16 interFoam -parallel Last edited by joshmccraney; April 30, 2020 at 22:18. |
|
April 30, 2020, 23:09 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
Assuming that you are starting from that 10s mark (with startFrom latestTime), you will need to edit the bc in the 10/U file -- the 0/U file will not be read, as you've found out. This could be a bit tricky since you're running in parallel. I'm not sure of the best way to go about this -- and someone should jump in if they do -- but off the top of my head you'll either need to edit the decomposed processor*/U file(s) or perhaps you could reconstruct, edit 10/U, and then decompose again.
Caelan |
|
May 1, 2020, 03:22 |
|
#3 | |
Senior Member
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 9 |
Quote:
If anyone else has suggestions I'm all ears. |
||
May 1, 2020, 05:47 |
|
#4 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,223
Rep Power: 28 |
Hello,
You can manually edit the processorN/10/U files with a for loop to udpate your boundary condition in every processor directories. BUT, you should check first what writeFormat you are using in your controlDict. It should be set to ascii, since obviously you won't be able to manually modify binary files. Another way around is to use the changeDictionary utility. I never used it for this specific case but it should do the job, using the option -latestTime in order to update the files in the last time steep. Cheers, Yann |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Transient rotating domain initialization from steady state run | asanchez84 | CFX | 0 | June 13, 2019 18:28 |
[ICEM] How to change blocking around the mesh with change in design parameters? | jainanup27 | ANSYS Meshing & Geometry | 0 | June 11, 2019 17:39 |
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' | muth | OpenFOAM Running, Solving & CFD | 3 | August 27, 2018 05:18 |
Stage Frame Change + Porous Domain | CFX_Beginner | CFX | 10 | August 10, 2015 05:28 |
crash:parallel run and writetime? | calim_cfd | OpenFOAM Bugs | 2 | March 5, 2012 20:13 |