|
[Sponsors] |
How to re-run the case with updated/corrected boundary condition |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 28, 2019, 04:58 |
How to re-run the case with updated/corrected boundary condition
|
#1 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17 |
Dear Foamers,
I was running a case of propellor and realized after many days that the boundary condition for the outer cylinder (top, bottom, front back etc) are not proper, thus wanted to change the present boundary condition of pressure from p=0 to zero gradient. Now since, I have been running the case for a week and don't want to spoil the time, thus is there any way to simply change the boundary condition at the present solution time step? I found that in the recent folder (suppose t=5 s) I had the files for pressure, velocity etc and in that the boundary heading is there, by changing this to the desired one will do the work ? Also for the 3D case the file is huge and to search the keyword boundary is cumbersome, is there any way to make it faster? Thanks! |
|
October 28, 2019, 06:03 |
|
#2 | ||
Senior Member
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8 |
Hi Chandra Shekar.
Quote:
If it is a serial case then it is a straight forward task, edit the required BC and continue running. Importnant: don't forget to change the startFrom to latestTime in controlDict. Quote:
K. Rao |
|||
October 28, 2019, 06:16 |
|
#3 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17 |
Hello Kmeti Rao,
Thanks, great! But now I could see that the files are in binary format, and after using the utility, "foamFormatConvert", this is sending an error which says: --> FOAM FATAL ERROR: Point motion detected but number of points 595219 in "/home/csp/OpenFOAM/csp-v1906/run/propeller_actual/trial_binary_ascii/0.09/polyMesh/points" does not correspond to current 3549 From function virtual Foam:olyMesh::readUpdateState Foam:olyMesh::readUpdate() in file meshes/polyMesh/polyMeshIO.C at line 447. Just wondering am I doing something silly? |
|
October 28, 2019, 06:22 |
|
#4 |
Senior Member
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8 |
I have never used this utility "foamFormatConvert". Why do you want to convert? Use the binary format file itself. Search for the particular boundary condition, edit it and save.
|
|
October 28, 2019, 06:28 |
|
#5 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17 |
Thanks, make sense.
|
|
October 29, 2019, 02:51 |
|
#6 |
Senior Member
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18 |
No no, you do not need to reconstruct, convert to ascii and edit by hand.
You can use changeDictionary to modify boundary conditions and boundary types on an existing solution, in parallel. Hope this helps, Francesco By the way, you cannot edit a binary file as if it was ascii, a text editor like vi would not treat the binary blocks correctly, so foamFormatConvert was the right thing, but changeDictionary is a much better solution in my opinion. Last edited by fra76; October 29, 2019 at 02:53. Reason: Notes on binary |
|
October 29, 2019, 02:59 |
|
#7 | |
Senior Member
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8 |
Quote:
Cheers!!! K. Rao |
||
October 29, 2019, 03:21 |
|
#8 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17 |
Many thanks K Rao and Francesco Del Citto for your valuable input.
Francesco Del Citto, could you please elaborate how to work with "changeDictionary" . I think I am clear in my question, so please help how to proceed in this? I am having binary files and I intend to change the boundary condition, does the same procedure is valid even if the ASCII files are there? To use the "foamFormatConvert" I first modified the controlDict in which I changed the "writeFormat" from binary to ASCII and then ran the "foamFormatConvert" to get the final folder in the ASCII, and finally modified the "boundary" keyword with "inlet, outlet" etc. Is it the same for "changeDictionary"? I had just started to use the OPenFoam, thus may be a little naive. Thanks a lot! |
|
October 29, 2019, 05:25 |
|
#9 |
Senior Member
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18 |
Do it the openfoam way!
Go to the installation directory, under applications/utilities/preProcessing or something like that you will find the changeDictionary application. Inside the directory there is a sample changeDictionaryDict you can use as reference. Copy it to your case, inside system, edit it and then run mpirun changeDictionary -latestTime. I’d make a copy of the whole case before, just to have a backup if something fails... Hope this helps, Francesco |
|
October 29, 2019, 07:25 |
|
#10 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17 |
Many thanks Francesco Del Citto for your help, I find the desired dictionary at OpenFOAM-v1906/applications/utilities/preProcessing/changeDictionary
Copied the whole changeDictionary into the system of my running folder, modified the C++ file (attached herewith, as for now just for trial), but still when trying to run the changeDictionary -latestTime, it is showing the error: --> FOAM FATAL ERROR: cannot find file "/home/csp/OpenFOAM/csp-v1906/run/2D_blunt_edge_rans_sigma0.93_aoa3_flowcontrol_comb ine_2sec/system/changeDictionaryDict" From function virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::uncollatedFileOperation::rea dStream(Foam::regIOobject&, const Foam::fileName&, const Foam::word&, bool) const in file global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C at line 548. FOAM exiting Is something else should be done, or something carefully be done. Sorry for being iterative in the questions. Thanks! |
|
October 29, 2019, 08:40 |
|
#11 |
Senior Member
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18 |
A lot of confusion here.
You do not need to change the C++ code. changeDictionary is an application that requires an input dictionary, called changeDictionaryDict. You can find an example of Thurman dictionary in the source directory of the application, but this does not mean you need to change the C++ code. The error message is clear as well, it cannot find system/changeDictionaryDict, so all you need to do is to copy that file to the system directory (just the dictionary, not the whole source directory), modify it according to your case and run the application changeDictionary. More than that, I cannot help... Cheers, Francesco |
|
October 29, 2019, 09:46 |
|
#12 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17 |
I am sincerely thankful to you Mr. Francesco Del Citto for your help, support and patience.
I think I misunderstood you, as you might have been knowing that, I was looking for that "changeDictionaryDict" and you eventually directed straight to the source code, that was a bit confusing for me. Now, I found that its actually been there at the: tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/bottomWater and when I tried it, it works fine. I am highly thankful for your valuable time and inputs. Thanks again! |
|
October 29, 2019, 10:47 |
|
#13 | |
Senior Member
Kmeti Rao
Join Date: May 2019
Posts: 145
Rep Power: 8 |
Quote:
Cheers! |
||
October 30, 2019, 02:24 |
|
#14 |
Senior Member
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17 |
Excellent, thanks a lot, now I could see the Dict also. Earlier I tried to search in the tutorial case for the desired Dict and it was really cumbersome. I think what you have suggested is more appropriate and straight forward, great!
Thanks again. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Centrifugal fan | j0hnny | CFX | 13 | October 1, 2019 14:55 |
CFD analaysis of Pelton turbine | amodpanthee | CFX | 31 | April 19, 2018 19:02 |
Problem in setting Boundary Condition | Madhatter92 | CFX | 12 | January 12, 2016 05:39 |
vorticity boundary condition | bearcharge | Main CFD Forum | 0 | May 14, 2010 12:32 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 05:05 |