CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

swak4Foam - cannot access volume fraction information

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Luttappy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 30, 2018, 08:06
Default swak4Foam - cannot access volume fraction information
  #1
Member
 
K
Join Date: Mar 2018
Posts: 34
Rep Power: 8
kuria is on a distinguished road
Hey everyone!


I am trying to implement a boundary condition using groovyBC which is dependent on the volume fraction of liquid (alpha1 in interFoam). But it looks like the variable is not available in swak4Foam (i get an approximate result by using 'rho').



This is what I tried:

right_wall
{
type groovyBC;
valueExpression "rho*1.23"; //replaicing rho with alpha1 or alpha.water does not work
}



Can anyone suggest how to declare the variable alpha1 for groovyBC?


Also how do I access the list of variable available in swak4Foam that can be used in the boundary condition definition?


Thank you so much in advance!
kuria is offline   Reply With Quote

Old   September 13, 2018, 03:29
Default
  #2
Member
 
K
Join Date: Mar 2018
Posts: 34
Rep Power: 8
kuria is on a distinguished road
If anyone was wondering how to do it,


codefixedvalue (which is no a part of swak4foam) can do the work. I found this link helpful :http://sourceflux.de/blog/the-codedf...ary-condition/


-Kurian
kuria is offline   Reply With Quote

Old   July 6, 2020, 14:58
Thumbs up "field alpha not existing or of wrong type"
  #3
Member
 
HK
Join Date: Oct 2015
Location: Madras
Posts: 31
Rep Power: 11
Luttappy is on a distinguished road
A similar problem happens with multiphaseEulerFoam as well.
When you try to access U or alphas, there wont be any error, but when you try to access alpha.water/alpha.air/U.water/U.air


Code:
    samplevariable {
        type swakExpression;
        valueType internalField;
        verbose true;  
        expression "vol()*alpha.water";
        accumulations (
            sum
        );
    }
This code is showing this error.

Code:
--> FOAM FATAL ERROR: 
 Parser Error for driver FieldValueExpressionDriver at "1.7-11" :"field alpha not existing or of wrong type"
"vol()*alpha.water"
       ^^^^^
-------|    

Context of the error:


- From dictionary: /media/pallab/E/HK1/1Repap/domain100/trial/system/controlDict.functions.volweightedvel
  Evaluating expression "vol()*alpha.water"


    From function parsingValue
    in file lnInclude/CommonValueExpressionDriverI.H at line 1250.

FOAM exiting
This is because phase name (like water, air) is not mentioned in the solver code, instead it is saved as variables (phasei).

Solution

You need to use aliases to save variable name.
For example;

Code:
    samplevariable {
        type swakExpression;
        valueType internalField;
        verbose true;
        aliases {
                alphaw alpha.water;
                }       
        expression "vol()*alphaw";
        accumulations (
            sum
        );
    }

I was struggling with this for a while, spent several hours to resolve this issue.
Thought of sharing here, such that it will be useful for somene.
Please correct me if this explanation is wrong
gschaider and ships26 like this.

Last edited by Luttappy; July 6, 2020 at 16:14.
Luttappy is offline   Reply With Quote

Reply

Tags
groovybc, swak4foam


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
multiphase turbulance case floating error harsha_kulkarni OpenFOAM Running, Solving & CFD 3 February 18, 2016 06:06
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
Macro to access MEAN volume fraction yashmash FLUENT 6 January 25, 2012 09:50
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 12:40.