
[Sponsors] 
August 19, 2014, 04:31 
groovyBC and access to alpha field of other patch

#1 
Senior Member
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,519
Blog Entries: 6
Rep Power: 27 
Hi all,
I want to get access from alpha field from patch1 to use it in patch2. The problem is that my alpha field does not exist? Code:
type groovyBC; variables "alphaFromPatch1{patch1}=alpha.liquid;"; valueExpression "alphaFromPatch1";
But always I get an error that this variable does not exist or is of wrong type. Does anyone have some idea? Additionall question: Is it possible to get velocity field U from patch1 and use it for patch2 not in an averaged value?
__________________
Best regards, Tobias Holzmann Some interesting OpenFOAM tutorials, publications and videos on www.Holzmanncfd.de OpenFOAM Beginners should check out the new wiki on wiki.openfoam.com A list of some active OpenFOAM contributers can be found »here« A book about the basics of »Mathematics, Numerics, Derivations and OpenFOAM« can be found on www.Holzmanncfd.de 

August 21, 2014, 19:05 

#2  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,953
Rep Power: 41 
Quote:
To find out under which name this field is known you'd have to consult the sources. Or there is a function object listRegisteredObjects that lists all objects currently registered in the registry. One of these objects should be your alpha Only if the patches are declared as mapped in the boundaryfile
__________________
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 

September 1, 2014, 16:09 

#3 
Senior Member
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,519
Blog Entries: 6
Rep Power: 27 
Dear Bernhard,
if I use mapped patch type I also get a interpolated velocity field: Code:
smoothSolver: Solving for alpha.liquid, Initial residual = 0, Final residual = 0, No Iterations 0 Phase1 volume fraction = 0.088941 Min(alpha1) = 0 Max(alpha1) = 1 MULES: Correcting alpha.liquid MULES: Correcting alpha.liquid Phase1 volume fraction = 0.088941 Min(alpha1) = 0 Max(alpha1) = 1 swak4Foam: Setting default mesh swak4Foam: Allocating new repository for sampledGlobalVariables DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 4.41011e06, No Iterations 3 DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 5.89124e06, No Iterations 3 GAMG: Solving for p_rgh, Initial residual = 1, Final residual = 0.00848398, No Iterations 5 > FOAM Warning : From function ExpressionResult::getUniformInternal(const label size,bool noWarn) in file ExpressionResult/ExpressionResultI.H at line 332 The minimum value (0.325913 0.0248373 0) and the maximum (0.135614 1.34743 0) differ. I will use the average (0.0315278 0.429949 0) time step continuity errors : sum local = 1.2011e06, global = 7.49768e07, cumulative = 7.49768e07 GAMG: Solving for p_rgh, Initial residual = 0.00236714, Final residual = 7.34319e09, No Iterations 31 > FOAM Warning : From function ExpressionResult::getUniformInternal(const label size,bool noWarn) in file ExpressionResult/ExpressionResultI.H at line 332 The minimum value (0.135501 0.000179205 0) and the maximum (0.101674 0.436928 0) differ. I will use the average (0.0170261 0.171489 0) time step continuity errors : sum local = 4.0578e11, global = 3.5819e11, cumulative = 7.49732e07 DILUPBiCG: Solving for epsilon, Initial residual = 0.0161811, Final residual = 1.53934e06, No Iterations 2 DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 2.04556e06, No Iterations 3 ExecutionTime = 0.36 s ClockTime = 1 s Code:
internalFacesForGroovyBC_master { type groovyBC; value uniform (0 0 0); variables "x1=5;y1=6;x2=30;y2=0;function1=(y2y1)/(x2x1)*(time()x1)+y1;x3=35;y3=0;x4=60;y4=4;function2=(y4y3)/(x4x3)*(time()x3)+y3;"; valueExpression "vector(0,0,0)"; gradientExpression "vector(0,0,0)"; fractionExpression "(time() < 5) ? 0 : 1"; } internalFacesForGroovyBC_slave { type groovyBC; variables "velo{internalFacesForGroovyBC_master}=U;"; valueExpression "velo"; value uniform (0 0 0); }
__________________
Best regards, Tobias Holzmann Some interesting OpenFOAM tutorials, publications and videos on www.Holzmanncfd.de OpenFOAM Beginners should check out the new wiki on wiki.openfoam.com A list of some active OpenFOAM contributers can be found »here« A book about the basics of »Mathematics, Numerics, Derivations and OpenFOAM« can be found on www.Holzmanncfd.de 

September 1, 2014, 16:55 

#4  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,953
Rep Power: 41 
Quote:
__________________
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 

September 2, 2014, 04:04 

#5 
Senior Member
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,519
Blog Entries: 6
Rep Power: 27 
Hi Bernhard,
many thanks to you. Mapping the velocity field U is working without problems now. I think it knows which patch to map out of the boundary file (sampleRegion or coupleGroup). I will have a look at your mentioned "aliases" to get the alpha field for the further step now. Thank you again.
__________________
Best regards, Tobias Holzmann Some interesting OpenFOAM tutorials, publications and videos on www.Holzmanncfd.de OpenFOAM Beginners should check out the new wiki on wiki.openfoam.com A list of some active OpenFOAM contributers can be found »here« A book about the basics of »Mathematics, Numerics, Derivations and OpenFOAM« can be found on www.Holzmanncfd.de 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
groovyBC and funkySetFields married and got a kid named swak4Foam  gschaider  OpenFOAM  164  January 13, 2015 03:52 
whats the trick to access to second layer of patch neighbors in groovyBC?  immortality  OpenFOAM  6  July 9, 2013 12:01 
Can groovyBC (swak4foam) access dimensionedScalar?  argonaut  OpenFOAM Running, Solving & CFD  1  May 24, 2012 09:04 
Wall heat transfer using groovyBC (XiFoam solver)  usergk  OpenFOAM  7  February 4, 2011 14:36 