|
[Sponsors] |
[ICEM] Scripting - For loops, expr function, integration |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 19, 2018, 13:44 |
Scripting - For loops, expr function, integration
|
#1 |
New Member
Alex
Join Date: Mar 2018
Posts: 4
Rep Power: 8 |
I am having trouble generating point geometry based around a curve equation. I wish to create several points to describe the curve, and want to do this via a for loop, as part of a project on automating geometry and mesh for given input parameters.
However, my current code returns several errors, including the For loop not being closed, and the 'integralExpr' function not being a valid command. Code:
ic_geo_new_family GEOM ic_empty_tetin set d_throat 0.1288 set d_ef 0.1524 set n_profiles 6 set x_duct 0.4572 set l_curve 0.481613 for {set i 0} {$i<$n_profiles} {set i [expr $i+1]} { set x_l [expr $i / ($n_profiles - 1)] set x_curve [expr $l_curve * $x_l] set x_global [integralExpr 0 $x_curve 10 sqrt(1 + (0.0225 * 3.14159 * 3.14159 * sin(3.14159 * $x_l) * sin(3.14159 * $x_l)))] set y_global 0 set z_global [expr -0.15 * $x_duct * (1 - cos(3.14159 * $x_l))] ic_point {} GEOM pnt.1 $x_global,$y_global,$z_global } |
|
March 20, 2018, 05:02 |
|
#2 |
Senior Member
Sebastian Engel
Join Date: Jun 2011
Location: Germany
Posts: 566
Rep Power: 20 |
Hi Alex,
before you continue, i suggest you to do a quick introduction into the scripting language "Tcl". There are indeed a few problems in your script.
Last edited by bluebase; March 20, 2018 at 05:22. Reason: better link |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] refineWallLayer Error | Yuby | OpenFOAM Meshing & Mesh Conversion | 2 | November 11, 2021 11:04 |
[blockMesh] Errors during blockMesh meshing | Madeleine P. Vincent | OpenFOAM Meshing & Mesh Conversion | 51 | May 30, 2016 10:51 |
[blockMesh] non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Meshing & Mesh Conversion | 7 | April 17, 2013 05:42 |
how to write an integration function in fluent | self_shattered | FLUENT | 1 | May 31, 2011 16:04 |
Droplet Evaporation | Christian | Main CFD Forum | 2 | February 27, 2007 06:27 |