|
[Sponsors] |
[swak4Foam] groovyBC and access to alpha field of other patch |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 19, 2014, 05:31 |
groovyBC and access to alpha field of other patch
|
#1 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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?
__________________
Keep foaming, Tobias Holzmann |
|
August 21, 2014, 20:05 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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 boundary-file
__________________
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, 17:09 |
|
#3 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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 Phase-1 volume fraction = 0.088941 Min(alpha1) = 0 Max(alpha1) = 1 MULES: Correcting alpha.liquid MULES: Correcting alpha.liquid Phase-1 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.41011e-06, No Iterations 3 DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 5.89124e-06, 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.2011e-06, global = -7.49768e-07, cumulative = -7.49768e-07 GAMG: Solving for p_rgh, Initial residual = 0.00236714, Final residual = 7.34319e-09, 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.0578e-11, global = 3.5819e-11, cumulative = -7.49732e-07 DILUPBiCG: Solving for epsilon, Initial residual = 0.0161811, Final residual = 1.53934e-06, No Iterations 2 DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 2.04556e-06, 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=(y2-y1)/(x2-x1)*(time()-x1)+y1;x3=35;y3=0;x4=60;y4=4;function2=(y4-y3)/(x4-x3)*(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); }
__________________
Keep foaming, Tobias Holzmann |
|
September 1, 2014, 17:55 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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, 05:04 |
|
#5 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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.
__________________
Keep foaming, Tobias Holzmann |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] codedMixed instead of groovyBC | GerHan | OpenFOAM Community Contributions | 3 | February 20, 2019 12:08 |
[swak4Foam] access field variables in groovyBC | mehtab | OpenFOAM Community Contributions | 11 | February 4, 2019 13:08 |
[swak4Foam] groovyBC and access to fields of other Regions | ancolli | OpenFOAM Community Contributions | 0 | July 29, 2017 09:41 |
[swak4Foam] whats the trick to access to second layer of patch neighbors in groovyBC? | immortality | OpenFOAM Community Contributions | 6 | July 9, 2013 13:01 |
[swak4Foam] Can groovyBC access dimensionedScalar? | argonaut | OpenFOAM Community Contributions | 1 | May 24, 2012 10:04 |