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

[swak4Foam] Track vortices using Swak4FOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By vinz

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 16, 2012, 10:32
Default
  #9
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
Ok I see, not straight forward but brilliant!

I manage to get something which looks interesting with the following lines:
Code:
    mask
    {
        type swakExpression;
	valueType internalField;
        variables (
            "maskField=(vorticity.z>0 || pos().y<0.3) ? 0 : 1;"
	);
        storedVariables (
            {
                name maskField;
                initialValue "0";
            }
        );
        expression "maskField";
	accumulations ( 
	   max
	);
        verbose true;        
    } 


    maxVortPos
    {
        type swakExpression;
	valueType internalField;
        variables (
	    "vortPos2= maxPosition((maskField>0) ? magVorticity : -1000);"
        );
        storedVariables (
            {
                name vortPos2;
                initialValue "vector(-0.4,1,0)";
            }
        );
        expression "vortPos2";
	accumulations ( 
	   max
	);
        verbose true;        
    } 

    maxVortPosY
    {
        type swakExpression;
	valueType internalField;
        expression "vortPos2.y";
	accumulations ( 
	   max
	);
        verbose true;        
    } 

    maxVortPosX
    {
        type swakExpression;
	valueType internalField;
        expression "vortPos2.x";
	accumulations ( 
	   max
	);
        verbose true;        
    }
Now I would like to compute the integral of U on a surface which would be a sphere centered on my vortex.
I tried the following to create such a sphere :
Code:
    distField
    {
        type expressionField;
        outputControl timeStep;
        outputInterval 1;
        fieldName distanceFromVortex;
        expression "mag(pos()-vortPos2)";
        autowrite true;        
    } 

    surfaceIsoDist
    {
        type swakExpression;
        valueType surface;
        surfaceName isoVortexDist;
        surface {
            type isoSurface;
            isoField distanceFromVortex;
            isoValue 0.15;
            interpolate true;
        }
        verbose true;
        expression "mag(U)";
        accumulations (
            min
            max
	    average
        );
    }
but it crashes complaining that vortPos2 does not exist or is of wrong type although I use it earlier to get vortPos2.x for instance.

Then I am wondering what type is expected at this place? Any idea?
vinz is offline   Reply With Quote

 


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
Why my track file is 0 K after the simulation is saved calmdown911 STAR-CCM+ 0 December 19, 2017 10:22
Hairpin vortices in turbulent channel flow using DNS Nitin Minocha Main CFD Forum 2 November 21, 2016 17:52
[swak4Foam] Rotating Wall Velocity and Swak4Foam mpanch13114 OpenFOAM Community Contributions 0 September 14, 2016 04:55
[swak4Foam] and twoPhaseEulerFoam mnikku OpenFOAM Community Contributions 1 February 19, 2016 05:21
[swak4Foam] fails in parallel with -otherTime? Phicau OpenFOAM Community Contributions 3 June 26, 2013 13:00


All times are GMT -4. The time now is 23:17.