|
[Sponsors] |
swak4Foam - cannot access volume fraction information |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 30, 2018, 08:06 |
swak4Foam - cannot access volume fraction information
|
#1 |
Member
K
Join Date: Mar 2018
Posts: 34
Rep Power: 8 |
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! |
|
September 13, 2018, 03:29 |
|
#2 |
Member
K
Join Date: Mar 2018
Posts: 34
Rep Power: 8 |
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 |
|
July 6, 2020, 14:58 |
"field alpha not existing or of wrong type"
|
#3 |
Member
HK
Join Date: Oct 2015
Location: Madras
Posts: 31
Rep Power: 11 |
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 ); } 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 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 Last edited by Luttappy; July 6, 2020 at 16:14. |
|
Tags |
groovybc, swak4foam |
|
|
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 |