CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Converting patch to wall

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 3 Post By wyldckat
  • 2 Post By wyldckat
  • 1 Post By Shawn_A
  • 3 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 4, 2010, 07:16
Default Converting patch to wall
  #1
Senior Member
 
Julien de Charentenay
Join Date: Jun 2009
Location: Australia
Posts: 231
Rep Power: 18
julien.decharentenay is on a distinguished road
Send a message via Skype™ to julien.decharentenay
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
julien.decharentenay is offline   Reply With Quote

Old   November 4, 2010, 19:45
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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;
        }
    }
}


// ************************************************************************* //
Then simply run changeDictionary on the case folder and voilá, boundary changed
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
Nicole, Bru and amber25 like this.
__________________
wyldckat is offline   Reply With Quote

Old   October 20, 2011, 15:58
Default
  #3
Member
 
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 15
Shawn_A is on a distinguished road
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
Shawn_A is offline   Reply With Quote

Old   October 20, 2011, 17:27
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
Do you get something like this:
Code:
-rw-r--r-- 1 user user 1774 2011-06-18 00:20 system/fvSolution
In bold are the permissions for User, Group and Others. For more about this see: http://en.wikipedia.org/wiki/Chmod

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   October 20, 2011, 18:05
Default
  #5
Member
 
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 15
Shawn_A is on a distinguished road
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
Shawn_A is offline   Reply With Quote

Old   October 20, 2011, 18:29
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
vs1 and CFD_10 like this.
__________________
wyldckat is offline   Reply With Quote

Old   October 21, 2011, 12:47
Default
  #7
Member
 
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 15
Shawn_A is on a distinguished road
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
vs1 likes this.
Shawn_A is offline   Reply With Quote

Old   September 5, 2012, 06:33
Default
  #8
Member
 
Florian
Join Date: Nov 2009
Posts: 59
Rep Power: 17
Horus is on a distinguished road
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:
dictionaryReplacement
{
fvSchemes
{
divSchemes
{
div(phi,U) Gauss linear;
}
}

}
(OF Headers removed). But changeDictionary gives the error:

--> 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?
Horus is offline   Reply With Quote

Old   September 5, 2012, 08:35
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Florian,

I gave you the answer the other day to your previous question:
Quote:
Originally Posted by wyldckat View Post
  • If you want to merge, in the sense of editing the dictionary, then you can use changeDictionary along with the option "-instance":
    Code:
    changeDictionary -instance system
    This way it will look for the files in the "system" folder.
    For more ideas:
    Code:
    changeDictionary -help
    find $FOAM_TUTORIALS $FOAM_UTILITIES -name changeDictionaryDict
Best regards,
Bruno
wenxu, yqxia and CFD_10 like this.
__________________
wyldckat is offline   Reply With Quote

Reply


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
[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


All times are GMT -4. The time now is 19:40.