|
[Sponsors] |
November 4, 2010, 07:16 |
Converting patch to wall
|
#1 |
Senior Member
|
Hi,
Using openFoam v1.7.0 I generate meshes for simpleFoam using Gmsh. The mesh is converted using gmshToFoam. Before running, I have to manually convert some of the boundary conditions from patch to wall in the polyMesh/boundary file. As I have a number of cases to run, I would like to automate the process. Is there any existing utility that can be employed for that purpose? Thanks in advance. Julien |
|
November 4, 2010, 19:45 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Julien,
Well, my hunch I told you about in todays email about changeDictionary was right. Based on the tutorial "incompressible/pisoFoam/les/pitzDailyDirectMapped", here is a modified file changeDictionaryDict in the folder system: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.1 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object changeDictionaryDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dictionaryReplacement { boundary { frontAndBack { type wall; } } } // ************************************************************************* // If you search for other changeDictionaryDict files, you'll find more examples. And here is the online Doxygen help for changeDictionary.C. Best regards, Bruno
__________________
|
|
October 20, 2011, 15:58 |
|
#3 |
Member
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 15 |
I've tried to use the same method change my boundary types, but I'm getting the error:
cannot open file file: ./rotor/system/fvSchemes at line 0 My directory structure is: Project/vawt/rotor where rotor contains the system & constant directories. changeDictionaryDict is located in the rotor/system folder. While in the vawt directory, I execute: changeDictionary -case rotor The only difference between my changeDictionaryDict file and what is show here is the name of my boundary and the type (empty instead of wall). I don't understand why this command is attempting to access fvSchemes. fvSchemes is not included in the system directory. If I add an fvSchemes file from one of the tutorials, Foam then looks for fvSolution. If I also copy fvSolution, the changeDictionary command is executed properly. Why is it looking for these files? Regards, Shawn |
|
October 20, 2011, 17:27 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Shawn,
That is an odd bug indeed. My guess is that the "fv*" files have improper permissions for usage. For example, if you run: Code:
ls -l rotor/system/fvSolution Code:
-rw-r--r-- 1 user user 1774 2011-06-18 00:20 system/fvSolution Best regards, Bruno
__________________
|
|
October 20, 2011, 18:05 |
|
#5 |
Member
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 15 |
Hi Bruno,
The behaviour is a little different that what you're thinking, I probably did not describe it well enough. If I have no fv files and attempt to run changeDictionary -case rotor I get the error that fv files cannot be found. This is because I have no fv file to begin with. If I copy and paste ANY fvSchemes and fvSolution files into the system folder, the changeDictionary command runs fine. What I don't understand is why changeDictionary looks for the fv files in the first place. I don't believe they are necessary for changeDictionary, or are they? Shawn |
|
October 20, 2011, 18:29 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Shawn,
Oooooo... now I get it! Well, this is OpenFOAM you are dealing with! As soon as an application is this well linked to the libOpenFOAM library, it will then have certain needs. Some of them is just that: the "fv*" files are key markers for an OpenFOAM case. If the case doesn't have such files, then it's not an OpenFOAM case Additionally, if you look at the tutorial "tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater", you will see that it is divided into several regions and each region has its own folder inside the "system" folder. And in that case, each region folder also needs its own set of "fv*" files! Best regards, Bruno
__________________
|
|
October 21, 2011, 12:47 |
|
#7 |
Member
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 15 |
Just to report back, changeDictionary requires fvSchemes and fvSolution in the system folder of the directory or region you're trying to perform changeDictionary on. The fvSolution file only requires the header, however, the fvSchemes file needs definitions for only:
divSchemes gradSchemes laplacianSchemes Subject to change with(out) notice. Cheers, Shawn |
|
September 5, 2012, 06:33 |
|
#8 | |
Member
Florian
Join Date: Nov 2009
Posts: 59
Rep Power: 17 |
Hey,
sorry to hijack that old thread, but the topic seems to fit. Can I also modify like fvSchemes, fvSolution or controlDict using changeDictionary? I try to using the file: Quote:
--> FOAM FATAL IO ERROR: cannot find file file: /home/florian/OpenFOAM/cavity/0/fvSchemes at line 0. Any way to also modify files in the system folder? |
||
September 5, 2012, 08:35 |
|
#9 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Florian,
I gave you the answer the other day to your previous question: Quote:
Bruno
__________________
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[CGNS] CGNS converters available | mbeaudoin | OpenFOAM Meshing & Mesh Conversion | 137 | December 14, 2018 05:20 |
Thin Wall Heat Transfer BC for rhoSimpleFoam | swahono | OpenFOAM Running, Solving & CFD | 12 | October 4, 2013 12:49 |
[Gmsh] gmshToFoam: patch vs wall | julien.decharentenay | OpenFOAM Meshing & Mesh Conversion | 0 | October 28, 2010 03:49 |
Patch which extrapolates pressure to a wall | steph79 | OpenFOAM Pre-Processing | 1 | October 9, 2010 17:31 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |