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

[swak4Foam] Using calculated swak expressions in another functions

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gschaider

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 21, 2016, 08:06
Default Using calculated swak expressions in another functions
  #1
Member
 
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 11
arsalan.dryi is on a distinguished road
Dear Foamers,

How could I use the calculated swak expressions at other functions for example like below:
Code:
    createInterface
    {
        type createSampledSurface;
        outputControl timeStep;
        outputInterval 1;
        surfaceName interface;
        surface {
            type isoSurface;
            isoField alpha.water;
            isoValue 0.5;
            interpolate true;
      		 }
    }

 surface
    {
	ignore_unimplemented_simpleFunctionObject::movePoints true;
        type swakExpression;
        valueType surface;
        surfaceName interface;
        verbose true;
        expression "sum(area())";
        accumulations (
            min
                   );
	autowrite true;
    }

    k
    {
	aliases {
 		alphawater alpha.water;
		}
	ignore_unimplemented_simpleFunctionObject::movePoints true;
        type swakExpression;
        valueType internalField;
	variables (
	"thres=0.5;"//which cells to keep
	"VolC= sum (alphawater < thres ? C*vol() : 0);"
	);        
	expression "VolC/surface";
        accumulations (
		average		
        );
    }
Here I want to use calculated area() from surface function in the k function, what kind of method should be implemented in this situation?
Moreover, we couldn't calculate area() in the k function separately because this function has an internalField valueType while using area() needs a surface valueType!

The second question is how could we use the runTime() value in the functions? I think it has a keyword but I don't remember that.

Any help and comment will be appreciated.
Regards,
Arsalan.
arsalan.dryi is offline   Reply With Quote

 

Tags
internalfield, surface, swak4foam, swakexpression


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
One more time: wall functions - SST CellZone OpenFOAM Pre-Processing 22 June 11, 2021 13:27
Wall functions - questions about implementation AlmostSurelyRob OpenFOAM Programming & Development 44 May 6, 2020 10:11
Wall functions vs. boundary layers kandelabr OpenFOAM Running, Solving & CFD 3 June 12, 2017 07:05
When I use the wall functions....! maximus Main CFD Forum 7 January 20, 2003 09:35
N-S equations:divergence free functions? D. Puigjaner Main CFD Forum 1 July 27, 2000 12:43


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