|
[Sponsors] |
January 6, 2016, 12:55 |
Farfield Script
|
#1 |
New Member
Join Date: Jan 2016
Posts: 18
Rep Power: 10 |
I want to automate the process of creating a rectangular farfield around an airfoil with a baffle.
For example if the length of the airfoil is 1 unit then the baffle goes 20*airfoil length and similarly all the way around until it completes the square/rectangle for the farfield. And I want it to start from the trailing edge of the airfoil. I have attached a pic of the kind of farfield I am looking for. But I can't seem to generate one that starts from the trailing edge. |
|
January 7, 2016, 10:47 |
|
#2 |
Senior Member
David Garlisch
Join Date: Jan 2013
Location: Fidelity Pointwise, Cadence Design Systems (Fort Worth, Texas Office)
Posts: 307
Rep Power: 14 |
Pointwise has a full scripting language called Glyph.
You can create the automation you want using Glyph. There are many example scripts on the Pointwise Github Repository. Also see: |
|
January 7, 2016, 12:27 |
|
#3 | |
New Member
Join Date: Jan 2016
Posts: 18
Rep Power: 10 |
Quote:
|
||
January 8, 2016, 10:50 |
|
#4 |
Senior Member
David Garlisch
Join Date: Jan 2013
Location: Fidelity Pointwise, Cadence Design Systems (Fort Worth, Texas Office)
Posts: 307
Rep Power: 14 |
After creating the farfield domain, you will need to:
I have attached an image that shows the topology of the domain's outer loop. This assembly procedure is the same you will be using in your automation script. To see the commands you will need, I suggest creating a journal file while assembling the domain (Script, Begin Journaling...). |
|
January 11, 2016, 09:19 |
|
#5 | |
New Member
Join Date: Jan 2016
Posts: 18
Rep Power: 10 |
Quote:
But when I try to create a line, instead of starting from the trailing edge it starts from the 0,0,0 point. I want the script to be able to find the end of the curve automatically. |
||
January 11, 2016, 11:36 |
|
#6 |
Senior Member
David Garlisch
Join Date: Jan 2013
Location: Fidelity Pointwise, Cadence Design Systems (Fort Worth, Texas Office)
Posts: 307
Rep Power: 14 |
Not much more I can do to help without seeing your starting airfoil data and the glyph script.
There are glyph calls to extract XYZ locations on curves and connectors. See docs for: pw::Curve pw::Connector You can also attend a Pointwise Glyph scripting class. |
|
January 11, 2016, 11:50 |
|
#7 | |
New Member
Join Date: Jan 2016
Posts: 18
Rep Power: 10 |
Quote:
I also can't seem to apply a value to the script to define a basic distance I will try those other things out |
||
January 11, 2016, 19:53 |
|
#8 |
Senior Member
David Garlisch
Join Date: Jan 2013
Location: Fidelity Pointwise, Cadence Design Systems (Fort Worth, Texas Office)
Posts: 307
Rep Power: 14 |
I have looked at the dat file and the script file.
You are very close. Unfortunately, I am not sure exactly what you are trying to accomplish. It would be helpful to post a PW file that contains an example of what you want the final grid to look like. Build this grid by hand while journaling.
Examine the journal to find the relevant commands you will need in your script. Please take a look at AirfoilMesh Script for an example. Good luck. |
|
January 12, 2016, 07:51 |
|
#9 | |||
New Member
Join Date: Jan 2016
Posts: 18
Rep Power: 10 |
Quote:
I am not having issues with the grid generation or dimensioning etc. I only seem to be having issues automatically generating that line from the trailing edge that works as a baffle as described by the T-Rex tutorial. I tried the journaling way. In the journal itself it has this command: Quote:
Like for example when i journal it I get a line that says: Quote:
Last edited by weigl; January 12, 2016 at 09:57. |
||||
January 12, 2016, 12:24 |
|
#10 |
Senior Member
David Garlisch
Join Date: Jan 2013
Location: Fidelity Pointwise, Cadence Design Systems (Fort Worth, Texas Office)
Posts: 307
Rep Power: 14 |
If I understand correctly, the $farfield value is the distance from the trailing edge point to the rear farfield.
Code:
# Get one of the airfoil curves set airfoilCrv [pw::DatabaseEntity getByName "curve-1"] # Get a curve point using parametric position: [list u v crv]. # This assumes that the curve's direction goes from LEdge (u=0) to TEdge (u=1). # Since this is a curve, the v parameter is ignored. set trailingEdgePt [pw::Application getXYZ [list 1 0 $airfoilCrv]] # compute the xyz at the rear farfield. set rearFarFieldPt [pwu::Vector3 add $trailingEdgePt [list $farfield 0 0]] # You can now create the "baffle" curve using $trailingEdgePt and $rearFarFieldPt Code:
set farfieldX2 [expr {$farfield * 2}] set topRightFarFieldPt [pwu::Vector3 add $rearFarFieldPt [list 0 $farfield 0]] set topLeftFarFieldPt [pwu::Vector3 add $topRightFarFieldPt [list -$farfieldX2 0 0]] set bottomLeftFarFieldPt [pwu::Vector3 add $topLeftFarFieldPt [list 0 -$farfieldX2 0]] set bottomRightFarFieldPt [pwu::Vector3 add $bottomLeftFarFieldPt [list $farfieldX2 0 0]] You can find all the documentation for these glyph calls on the Pointwise website. Last edited by dgarlisch; January 12, 2016 at 13:25. Reason: typo |
|
January 12, 2016, 13:17 |
|
#11 | |
New Member
Join Date: Jan 2016
Posts: 18
Rep Power: 10 |
Quote:
Code:
invalid command name "pw:DatabaseEntity" invalid command name "pw:DatabaseEntity" while executing "pw:DatabaseEntity getByName "curve-1"" (procedure "afMesh" line 25) invoked from within "afMesh" invoked from within ".mesh.af2.dbb invoke " invoked from within ".mesh.af2.dbb instate {pressed !disabled} { .mesh.af2.dbb state !pressed; .mesh.af2.dbb invoke } " (command bound to event) |
||
January 12, 2016, 13:27 |
|
#12 |
Senior Member
David Garlisch
Join Date: Jan 2013
Location: Fidelity Pointwise, Cadence Design Systems (Fort Worth, Texas Office)
Posts: 307
Rep Power: 14 |
Sorry. There was a typo in my script!
pw:DatabaseEntity should be pw::DatabaseEntity |
|
January 12, 2016, 13:51 |
|
#13 | |
New Member
Join Date: Jan 2016
Posts: 18
Rep Power: 10 |
Quote:
sorry to be such a bugger. Unfortunately I have very less time to finish this script so I don't have the luxury of learning it from beginning to end. Thank you very very much. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Workbench] Run ICEM Script in Workbench Script | MIZOR | ANSYS Meshing & Geometry | 9 | April 4, 2018 07:45 |
Farfield Size and Shape | tcarrigan | Pointwise & Gridgen | 1 | April 15, 2016 19:29 |
CentFOAM Python Script Installation: Error | socon009 | OpenFOAM Installation | 2 | May 26, 2012 09:36 |
Pressure farfield vs Velocity Inlet BC | DarrenC | FLUENT | 1 | September 16, 2009 02:23 |
Perl script for intialisation | pratik mehta | CFX | 2 | September 10, 2008 03:09 |