CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] Can't use grad(U) in a swakExpression!

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2019, 15:27
Exclamation Can't use grad(U) in a swakExpression!
New Member
Bernardo Ribeiro
Join Date: Aug 2016
Posts: 12
Rep Power: 5
beluiz93 is on a distinguished road
Hello all,

I'm having a hard time calculating the viscous dissipation term in my flow field. Basically what I'm doing is multiplying the shear stress tensor times the strain rate tensor.

This is my expression:

type swakExpression;
valueType cellZone;
zoneName controlvolume35by25_lead;
"viscousdiss_lead=0.002*(pow(grad(U).xx,2)) + 0.001*(pow((grad(U).xy+grad(U).yx),2)) + 0.002*(pow(grad(U).yy,2));"
accumulations ( integrate );
expression "viscousdiss_lead";
verbose true;
writeStartTime no;
autoInterpolate true;
warnAutoInterpolate false;
autowrite true;

And the error I get:

Parser Error for driver CellZoneValueExpressionDriver at "1.1-4" :"field grad not existing or of wrong type"

I've seen other posts somewhat related to this but it seems it's not working when we try to use grad(U). I'm aware of snGrad but I can't use this one since what I want it's an integral of that in a specific cellZone. Any ideas on how to proceed?

Thanks in advance!

beluiz93 is offline   Reply With Quote

Old   October 15, 2019, 15:56
Exclamation of4.1
New Member
Bernardo Ribeiro
Join Date: Aug 2016
Posts: 12
Rep Power: 5
beluiz93 is on a distinguished road
I managed to get a workaround if a replace grad(U) to gradU (rename it) but since this field is obtained in of4.1, I needed to change my patchField from extrapolatedCalculated to calculated and then it works...

Is it possible to use of4.1 with swak4foam?

Thanks again in advance!
beluiz93 is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Error while postProcessing icoFoam case to get grad(U) shashanktiwari619 OpenFOAM Post-Processing 1 July 29, 2019 02:47
Long output in terminal. ssa_cfd OpenFOAM Running, Solving & CFD 1 March 18, 2019 05:25
Question on the sequence of grad(U) components ripperjack OpenFOAM Post-Processing 1 September 18, 2018 12:19
div(phi,U) linearUpwind default; or div(phi,U) linearUpwind grad(U); cyln OpenFOAM Running, Solving & CFD 8 August 1, 2018 08:46
[swak4Foam] different values between swakExpression & faceSource areaAverage Paebin OpenFOAM Community Contributions 7 December 23, 2015 11:29

All times are GMT -4. The time now is 12:24.