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

[swak4Foam] visualize surface defined in swakExpression

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2018, 02:37
Default visualize surface defined in swakExpression
  #1
Member
 
Fynn
Join Date: Feb 2016
Posts: 48
Rep Power: 10
PanPeter is on a distinguished road
Hi,

I am sampling values on a half-plane using swak. The example beneath works fine but I would like to know if there is a possibility to also export the defined surface as a stl.

Or would it be possible to pre-define a surface that I can supply my swak expression with? Since my mesh is moving, it should not be a faceSet or faceZone, as these are moving with the mesh.

Thanks

Code:
name
    {
    	type swakExpression;
    	valueType surface;
    	surfaceName name2;
    	surface {
    	    type plane;
    	    surfaceType searchablePlate;
    	    span         (100 -100 0);
    	    origin       (0 1 0);
    	    normalVector    (0 0 1);
    	    basePoint    (0 1 0);
    	    // interpolate false;
    	}
    	verbose true;
    	expression "mag(U)";
    	ignore_unimplemented_simpleFunctionObject::movePoints true;
    	accumulations (
    	    min
    	    max
    	    );
    }

Last edited by PanPeter; February 22, 2018 at 03:55.
PanPeter is offline   Reply With Quote

Old   February 22, 2018, 03:55
Default half plane not defined
  #2
Member
 
Fynn
Join Date: Feb 2016
Posts: 48
Rep Power: 10
PanPeter is on a distinguished road
I can't define a half plane as described above:

When changing the expression to
Code:
mag(Sf())
the surface are of my plane should be returned. It shows the surface area of the whole cut plane, not of my half-plane only.

Has anybody defined a searchablePlate inside a swakExpression and could give me a hint how this could be solved?
PanPeter is offline   Reply With Quote

Old   February 22, 2018, 06:30
Default half-plane work around
  #3
Member
 
Fynn
Join Date: Feb 2016
Posts: 48
Rep Power: 10
PanPeter is on a distinguished road
Hi,
I've tried to find solutions to define the sampling over a half plane and couldn't find anything but the definition of external stl files.

So I thought of this work-around: A plane is defined, instead of a half plane, and the swak expression only takes values of cells, whose dependent coordinate is smaller than some threshold (y0 in this case).

Code:
underScreenSurface{
	y0 // define it here
    	type swakExpression;
    	valueType surface;
	surfaceName normalZ;
	surface{
	    type plane;
	    basePoint		(0 0 0);
	    normalVector    	(0 0 1);
	}
    	verbose true;
    	expression "(pos().y <= $y0) ? mag(Sf()) : 0";
    	accumulations (
	    sum
    	    );
    }
PanPeter is offline   Reply With Quote

Old   February 25, 2018, 14:55
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by PanPeter View Post
Hi,
I've tried to find solutions to define the sampling over a half plane and couldn't find anything but the definition of external stl files.

So I thought of this work-around: A plane is defined, instead of a half plane, and the swak expression only takes values of cells, whose dependent coordinate is smaller than some threshold (y0 in this case).

Code:
underScreenSurface{
    y0 // define it here
        type swakExpression;
        valueType surface;
    surfaceName normalZ;
    surface{
        type plane;
        basePoint        (0 0 0);
        normalVector        (0 0 1);
    }
        verbose true;
        expression "(pos().y <= $y0) ? mag(Sf()) : 0";
        accumulations (
        sum
            );
    }
Try adding
Code:
        writeSurfaceOnConstruction true;
        autoWriteSurface true;
        surfaceFormat vtk;
You should get a directory surfacesRepository with the vtk-files in each time-step that is written (only the geometry. No values)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Tags
moving mesh, surface sampling


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
[ICEM] Surface mesh not sticking to surface holtwong ANSYS Meshing & Geometry 2 April 20, 2023 09:28
Scale Surface CellZone OpenFOAM Post-Processing 1 September 2, 2016 09:29
[ICEM] surface mesh merging problem everest ANSYS Meshing & Geometry 44 April 14, 2016 07:41
user surface in post xinzhangabc CFX 0 February 24, 2005 07:29


All times are GMT -4. The time now is 16:51.