CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] Access the gravity vector in swak4foam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 25, 2017, 13:26
Default Access the gravity vector in swak4foam
  #1
Member
 
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 40
Rep Power: 11
lourencosm is on a distinguished road
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;
}
I get this error:
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
What am I missing?

Thank you,
Lourenço
lourencosm is offline   Reply With Quote

Old   March 18, 2019, 16:25
Default
  #2
Member
 
Join Date: Oct 2015
Posts: 63
Rep Power: 10
Scram_1 is on a distinguished road
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
Scram_1 is offline   Reply With Quote

Old   March 19, 2019, 10:30
Default
  #3
Member
 
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 40
Rep Power: 11
lourencosm is on a distinguished road
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
lourencosm is offline   Reply With Quote

Reply

Tags
gravity, 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
Is there a way to access the gradient limiter in Fluent ? CFDYourself FLUENT 1 February 16, 2016 05:49
[swak4Foam] fails in parallel with -otherTime? Phicau OpenFOAM Community Contributions 3 June 26, 2013 13:00
Convergence problem when use gravity aroma STAR-CCM+ 1 April 10, 2013 10:18
[swak4Foam] Can groovyBC access dimensionedScalar? argonaut OpenFOAM Community Contributions 1 May 24, 2012 09:04
[swak4Foam] Installing swak4foam Without Internet Access joel.lehikoinen OpenFOAM Community Contributions 2 June 17, 2011 05:12


All times are GMT -4. The time now is 18:32.