CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Gmsh] Editing .geo file to be used with DAKOTA!

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By CFD-Lover

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2017, 23:14
Default Editing .geo file to be used with DAKOTA!
  #1
Member
 
OpenFoam
Join Date: Jun 2016
Posts: 82
Rep Power: 9
CFD-Lover is on a distinguished road
Hi,

I am following some examples on how to couple DAKOTA with OpenFoam. The examples were created by Wolf-Dynamics. I have noticed that most of the examples deal with SnappyHEX mesh only. However, I have come to a mesh that is created with gmsh. The mesh has one design variable that I wish to be changed through the optimization process. For instance,
Code:
D = 5; // Diameter
h = 0.1*D; // 
Theta = 4;//
All, I want it to know is a way to tell gmsh or .geo to change the variable Theta to {x1}, so it can then match the design variables in the dakota.in file and create a new mesh. I am hoping to find easy way similar to that when openscas used to manipulate the stl files.

Thanks in advance for you kind help.

Regards,
CFD-Lover is offline   Reply With Quote

Old   June 5, 2017, 01:33
Default
  #2
Member
 
OpenFoam
Join Date: Jun 2016
Posts: 82
Rep Power: 9
CFD-Lover is on a distinguished road
Ok.

I put the geo file in the templatedir and named it geo.template putting theta={x1}. In the simulator_script file, I used;

Code:
dprepro $1 geo.template geo.in
I have noticed that the x1 has changed to the corresponding value in the Dakota input file. However, the dprepro manipulated some other points in the new geo file, causing an issue when I wanted to re-mesh it with the new value due to having points in the following format;

Code:
Point(1) = {-7.5*D, 10*D, 0, 0};
Point(2) = {12.5*D, 10*D, 0, 0};
I want to tell dprepro tool to avoid manipulating these points that have the curly brackets. Is there any way to do that?
Best,
CFD-Lover is offline   Reply With Quote

Old   June 5, 2017, 02:05
Default
  #3
Member
 
OpenFoam
Join Date: Jun 2016
Posts: 82
Rep Power: 9
CFD-Lover is on a distinguished road
Alright, the problem is solved by simply changing the dprepro file to the following ;

Code:
# default delimiters are curly braces { }
my $ld = "\{";
my $rd = "\}";
to

Code:
# default delimiters are curly braces { }
my $ld = "\{{";
my $rd = "\}}";
I hope someone else find it helpful.

Best,
elvis and alp.tiken like this.
CFD-Lover is offline   Reply With Quote

Old   April 29, 2020, 01:32
Default Regarding the .geo file and the dprepo
  #4
New Member
 
Edwin Rajeev
Join Date: Dec 2019
Location: Florida
Posts: 14
Rep Power: 6
edwinrajeev is on a distinguished road
Hi I came across this post and this is the only one of the kind. Could you possibly upload the case setup directory if you still probably have it?

I was facing issues doing this and for some reason the .geo file is not being modified.

Thanks in advance
edwinrajeev is offline   Reply With Quote

Old   April 29, 2020, 11:23
Default Solved it
  #5
New Member
 
Edwin Rajeev
Join Date: Dec 2019
Location: Florida
Posts: 14
Rep Power: 6
edwinrajeev is on a distinguished road
wrote a python code to modify the gmsh file. and dprepo modified the the variable within the python code.
edwinrajeev 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
how to calculate mass flow rate on patches and summation of that during the run? immortality OpenFOAM Post-Processing 104 February 16, 2021 08:46
[swak4Foam] Problem installing swak_2.x for OpenFoam-2.4.0 towanda OpenFOAM Community Contributions 6 September 5, 2015 21:03
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 19:43
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24


All times are GMT -4. The time now is 21:18.