|
[Sponsors] |
[swak4Foam] Access the gravity vector in swak4foam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 25, 2017, 14:26 |
Access the gravity vector in swak4foam
|
#1 |
Member
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 41
Rep Power: 12 |
How can I access to the gravity vector "g" from swak4foam?
Tried this but "g" is not recognised by the swakExpression Code:
getG { type executeIfObjectExists; readDuringConstruction true; objectName g; checkType true; objectType uniformDimensionedVectorField; objectShouldExist false; functions { loadG { type readGravitation; } } outputControlMode timeStep; //timeStep outputInterval 1; verbose true; } gz { type swakExpression; valueType patch; patchName inlet; expression "mag(g)*pos().z"; accumulations ( average ) outputControlMode timeStep; //timeStep outputInterval 1; verbose true; } Code:
[0] --> FOAM FATAL ERROR: [0] Parser Error for driver PatchValueExpressionDriver at "1.5" :"field g not existing or of wrong type" "mag(g)*pos().z" ^ ------| Context of the error: - From dictionary: /home/lourenco/currentRuns/ihFoam_aw/2_codeTest/v01_shiFly/10x1f_mB3L_s02_functionsTest/system/controlDict.functions.gz Evaluating expression "mag(g)*pos().z" [0] [0] [0] From function parsingValue [0] in file lnInclude/CommonValueExpressionDriverI.H at line 1204. [0] FOAM parallel run exiting [0] [1] [1] [1] --> FOAM FATAL ERROR: [1] Parser Error for driver PatchValueExpressionDriver at "1.5" :"field g not existing or of wrong type" "mag(g)*pos().z" ^ ------| Context of the error: - From dictionary: IOstream.functions.gz Evaluating expression "mag(g)*pos().z" [1] [1] [1] From function parsingValue [1] in file lnInclude/CommonValueExpressionDriverI.H at line 1204. [1] FOAM parallel run exiting [1] [2] [2] [2] --> FOAM FATAL ERROR: [2] Parser Error for driver PatchValueExpressionDriver at "1.5" :"field g not existing or of wrong type" "mag(g)*pos().z" ^ ------| Context of the error: - From dictionary: IOstream.functions.gz Evaluating expression "mag(g)*pos().z" [2] [2] [2] From function parsingValue [2] in file lnInclude/CommonValueExpressionDriverI.H at line 1204. [2] FOAM parallel run exiting [2] [3] [3] [3] --> FOAM FATAL ERROR: [3] Parser Error for driver PatchValueExpressionDriver at "1.5" :"field g not existing or of wrong type" "mag(g)*pos().z" ^ ------| Context of the error: - From dictionary: IOstream.functions.gz Evaluating expression "mag(g)*pos().z" [3] [3] [3] From function parsingValue [3] in file lnInclude/CommonValueExpressionDriverI.H at line 1204. [3] FOAM parallel run exiting [3] [4] [4] [4] --> FOAM FATAL ERROR: [4] Parser Error for driver PatchValueExpressionDriver at "1.5" :"field g not existing or of wrong type" "mag(g)*pos().z" ^ ------| Context of the error: - From dictionary: IOstream.functions.gz Evaluating expression "mag(g)*pos().z" [4] [4] [4] From function parsingValue [4] in file lnInclude/CommonValueExpressionDriverI.H at line 1204. [4] FOAM parallel run exiting [4] Expression gz : --> FOAM Warning : From function ConcretePluginFunction<DriverType>::exists in file lnInclude/ConcretePluginFunction.C at line 121 Constructor table of plugin functions for PatchValueExpressionDriver is not initialized Thank you, Lourenço |
|
March 18, 2019, 17:25 |
|
#2 |
Member
Join Date: Oct 2015
Posts: 63
Rep Power: 11 |
Hey Lourenco!
I'm facing a similar problem where OF is not recognizing gravity when I use groovyBC in parallel. Did you find a work around to this problem? Thanks!! Best, Sriram |
|
March 19, 2019, 11:30 |
|
#3 |
Member
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 41
Rep Power: 12 |
Hey Scram_1,
I didn't. I did a workaround... I was using this in a postProcessing swakExpression of a case with gravitational acceleration not aligned with the z axis. In the end I introduced the orientation manually in the swakExpression. Sorry! Please write here if you find the solution. Good luck, Lourenço |
|
Tags |
gravity, swak4foam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is there a way to access the gradient limiter in Fluent ? | CFDYourself | FLUENT | 1 | February 16, 2016 06:49 |
[swak4Foam] fails in parallel with -otherTime? | Phicau | OpenFOAM Community Contributions | 3 | June 26, 2013 14:00 |
Convergence problem when use gravity | aroma | STAR-CCM+ | 1 | April 10, 2013 11:18 |
[swak4Foam] Can groovyBC access dimensionedScalar? | argonaut | OpenFOAM Community Contributions | 1 | May 24, 2012 10:04 |
[swak4Foam] Installing swak4foam Without Internet Access | joel.lehikoinen | OpenFOAM Community Contributions | 2 | June 17, 2011 06:12 |