CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Problem to calculate grad(U) using swak4Foam (http://www.cfd-online.com/Forums/openfoam-post-processing/98667-problem-calculate-grad-u-using-swak4foam.html)

Hugoles March 15, 2012 17:43

Problem to calculate grad(U) using swak4Foam
 
Dear Foamers,

I need to calculate the strain rate tensor S_ij . In OpenFOAM this is made using the relation S_ij = symm(grad(U)). I am trying do this with swak4Foam (funkyDoCalc) but I just can't calculate grad(U). The error is the following:
Code:

Time = 1100
strainRate : swak4Foam: Allocating new repository for sampledGlobalVariables


--> FOAM FATAL ERROR:
 Parser Error at "1.7" :"syntax error, unexpected ')'"
"grad(U)"
"      ^"

    From function parsingValue
    in file lnInclude/CommonValueExpressionDriverI.H at line 718.

FOAM exiting

I can calculate grad(U.x), so I wonder if this problem has to do with how swak4Foam handles tensors. OpenFOAM can handle this expression without a problem, but it would be nice to avoid the (little) programming. Any ideas?

Thanks,

Hugo

gschaider March 15, 2012 19:06

Quote:

Originally Posted by Hugoles (Post 349726)
Dear Foamers,

I need to calculate the strain rate tensor S_ij . In OpenFOAM this is made using the relation S_ij = symm(grad(U)). I am trying do this with swak4Foam (funkyDoCalc) but I just can't calculate grad(U). The error is the following:
Code:

Time = 1100
strainRate : swak4Foam: Allocating new repository for sampledGlobalVariables


--> FOAM FATAL ERROR:
 Parser Error at "1.7" :"syntax error, unexpected ')'"
"grad(U)"
"      ^"

    From function parsingValue
    in file lnInclude/CommonValueExpressionDriverI.H at line 718.

FOAM exiting

I can calculate grad(U.x), so I wonder if this problem has to do with how swak4Foam handles tensors. OpenFOAM can handle this expression without a problem, but it would be nice to avoid the (little) programming. Any ideas?

Thanks,

Hugo

Had a quick look at the grammar. Seems that the gradient of a vector is currently not supported. Can't fix that today. Could you please write a bug-report so that I don't forget

Hugoles March 15, 2012 19:52

Quote:

Originally Posted by gschaider (Post 349737)
Had a quick look at the grammar. Seems that the gradient of a vector is currently not supported. Can't fix that today. Could you please write a bug-report so that I don't forget

Done! Likewise, can swak make operations over tensors such as mag(symm(grad(U))) ? Not sure if the feature is about only the grad of vectors or about tensors in general.

Thanks Bernhard,

Hugo

Hugoles March 19, 2012 17:16

2 Attachment(s)
Thanks for the patch!

I applied it to 1.6 but I still get the

Code:

Parser Error at "1.1-4" :"field grad not existing or of wrong type"
"grad(U)"
" ^^^^  "

    From function parsingValue
    in file lnInclude/CommonValueExpressionDriverI.H at line 724.

FOAM exiting

when I try to calculate grad(U).

Furthermore, I pulled the developing version with mercurial and I get errors when trying to recompile in OF 1.7.1 on OS X 10.6.8. I tried in a desktop and in a laptop with the same result. The recompilation in Ubuntu 11.04 showed -apparently- no errors.

Could you please take a look at the attachment ?

Thanks!

h

gschaider March 20, 2012 19:43

Quote:

Originally Posted by Hugoles (Post 350292)
Thanks for the patch!

I applied it to 1.6 but I still get the

Code:

Parser Error at "1.1-4" :"field grad not existing or of wrong type"
"grad(U)"
" ^^^^  "

    From function parsingValue
    in file lnInclude/CommonValueExpressionDriverI.H at line 724.

FOAM exiting

when I try to calculate grad(U).

Furthermore, I pulled the developing version with mercurial and I get errors when trying to recompile in OF 1.7.1 on OS X 10.6.8. I tried in a desktop and in a laptop with the same result. The recompilation in Ubuntu 11.04 showed -apparently- no errors.

Could you please take a look at the attachment ?

Thanks!

h

The Mac-Problem: seems like the compiler can't find any of the .H-files in your OF-installation. I can only guess why that is. Try at least removing all deb-files with rmdeball. If that still happens have a look whether directories like $FOAM_SRC/OpenFOAM/lnINclude are there


All times are GMT -4. The time now is 13:28.