{"id":1021,"date":"2014-12-02T02:33:39","date_gmt":"2014-12-02T02:33:39","guid":{"rendered":"http:\/\/people.utm.my\/dr-sukri\/?p=1021"},"modified":"2014-12-26T07:40:46","modified_gmt":"2014-12-26T07:40:46","slug":"transformpoints","status":"publish","type":"post","link":"https:\/\/people.utm.my\/dr-sukri\/2014\/12\/02\/transformpoints\/","title":{"rendered":"transformPoints"},"content":{"rendered":"<p>This post is for OpenFOAM user.<\/p>\n<p>Most of the times, we need to import CAD drawing to OpenFOAM, especially for the complex geomtery. The dimension in the drawing\u00a0somehow may changes after we imported into OpenFOAM.<\/p>\n<p>with &#8216;transformPoints&#8217; utilitiy, we can manipulate the coordinate of the imported file to our requirement. Refer to this site for complete explanation:<\/p>\n<p>https:\/\/openfoamwiki.net\/index.php\/TransformPoints<\/p>\n<p>Example: if we want to scale the CAD drawing to a factor of 0.01 in x and y directions:<\/p>\n<p>&gt;&gt; tranformPoints -scale &#8216;(0.01 0.01 1)&#8217;<\/p>\n<p>if the surface is not smooth (due to the sudden change in geometry) use surfaceFeatureExtractDict, e.g.: tutorials\/mesh\/snappyHexMesh\/flange<\/p>\n<p>or snapEdgeDict http:\/\/openfoamwiki.net\/index.php\/Contrib_snapEdge<\/p>\n<p>&nbsp;<\/p>\n<p>\/*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;*- C++ -*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*\\<br \/>\n| =========\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n| \\\\\u00a0\u00a0\u00a0\u00a0\u00a0 \/\u00a0 F ield\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | OpenFOAM: The Open Source CFD Toolbox\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n|\u00a0 \\\\\u00a0\u00a0\u00a0 \/\u00a0\u00a0 O peration\u00a0\u00a0\u00a0\u00a0 | Version:\u00a0 1.7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n|\u00a0\u00a0 \\\\\u00a0 \/\u00a0\u00a0\u00a0 A nd\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | Web:\u00a0\u00a0\u00a0\u00a0\u00a0 http:\/\/www.OpenFOAM.org\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n|\u00a0\u00a0\u00a0 \\\\\/\u00a0\u00a0\u00a0\u00a0 M anipulation\u00a0 |\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 |<br \/>\n\\*&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*\/<br \/>\nFoamFile<br \/>\n{<br \/>\nversion\u00a0\u00a0\u00a0\u00a0 2.0;<br \/>\nformat\u00a0\u00a0\u00a0\u00a0\u00a0 ascii;<br \/>\nclass\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 dictionary;<br \/>\nlocation\u00a0\u00a0\u00a0 &#8220;constant&#8221;;<br \/>\nobject\u00a0\u00a0\u00a0\u00a0\u00a0 snapEdgeDict;<br \/>\n}<\/p>\n<p>snapEdgeDict<br \/>\n{<\/p>\n<p>\/*snapPatches<br \/>\n(<br \/>\n);<\/p>\n<p>snapZones<br \/>\n(<br \/>\n);*\/<\/p>\n<p>stlFileNames<br \/>\n(<br \/>\nsquare.stl<br \/>\n);<\/p>\n<p>\/\/ only move those points that are closer to the features than the tolerance*| edge length |<br \/>\ntolerance 1.9;<\/p>\n<p>\/\/ 1.0 = move the points to the edge, 0 = dont move the point<br \/>\n\/\/ under-relaxation works better with many iterations to capture corners<br \/>\nrelaxation 0.1;<\/p>\n<p>\/\/ number of iterations to move points towards edge<br \/>\nnIterations 15;<\/p>\n<p>\/\/ set to yes if edges inside a patch should be included<br \/>\n\/\/ set to no if only the edges of the patch should be moved<br \/>\n\/\/ in general: set this to no to get optimal mapping of inlet\/outlet patches<br \/>\n\/\/ this ensures that wall-faces and inlet\/outlet-faces are mapped to correct positions<br \/>\nincludeInterior yes;<\/p>\n<p>\/\/ resolve all features with greater angle than this<br \/>\nfeatureAngle 90.0;<\/p>\n<p>\/\/ do not snap edges with an angle greater than this to the feature line<br \/>\nexcludeEdgeAngle 60;<\/p>\n<p>\/\/ used when selecting between multiple edges to map to the same position<br \/>\n\/\/ if the angle is above this value<br \/>\n\/\/\u00a0\u00a0\u00a0\u00a0 the choice will be based on which edge has the smallest angle to feature line<br \/>\n\/\/ otherwise<br \/>\n\/\/\u00a0\u00a0\u00a0\u00a0 the choice will be based on which edge is closest<br \/>\nparallelAngle 50.0;<\/p>\n<p>\/\/ allow for small overlap when fitting the edges to feature lines<br \/>\nfitFactor 1.0e-2;<\/p>\n<p>}<\/p>\n<p>enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is for OpenFOAM user. Most of the times, we need to import CAD drawing to OpenFOAM, especially for the complex geomtery. The dimension in the drawing\u00a0somehow may changes after we imported into OpenFOAM. with &#8216;transformPoints&#8217; utilitiy, we can &hellip; <a href=\"https:\/\/people.utm.my\/dr-sukri\/2014\/12\/02\/transformpoints\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":359,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[96,75],"class_list":["post-1021","post","type-post","status-publish","format-standard","hentry","category-cfd","tag-cfd","tag-openfoam"],"_links":{"self":[{"href":"https:\/\/people.utm.my\/dr-sukri\/wp-json\/wp\/v2\/posts\/1021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.utm.my\/dr-sukri\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/people.utm.my\/dr-sukri\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/people.utm.my\/dr-sukri\/wp-json\/wp\/v2\/users\/359"}],"replies":[{"embeddable":true,"href":"https:\/\/people.utm.my\/dr-sukri\/wp-json\/wp\/v2\/comments?post=1021"}],"version-history":[{"count":7,"href":"https:\/\/people.utm.my\/dr-sukri\/wp-json\/wp\/v2\/posts\/1021\/revisions"}],"predecessor-version":[{"id":1025,"href":"https:\/\/people.utm.my\/dr-sukri\/wp-json\/wp\/v2\/posts\/1021\/revisions\/1025"}],"wp:attachment":[{"href":"https:\/\/people.utm.my\/dr-sukri\/wp-json\/wp\/v2\/media?parent=1021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/people.utm.my\/dr-sukri\/wp-json\/wp\/v2\/categories?post=1021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/people.utm.my\/dr-sukri\/wp-json\/wp\/v2\/tags?post=1021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}