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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2019, 15:27
Exclamation Can't use grad(U) in a swakExpression!
  #1
New Member
 
Bernardo Ribeiro
Join Date: Aug 2016
Posts: 13
Rep Power: 9
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:



ViscousDiss_lead
{
type swakExpression;
valueType cellZone;
zoneName controlvolume35by25_lead;
variables
(
"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:


--> FOAM FATAL ERROR:
Parser Error for driver CellZoneValueExpressionDriver at "1.1-4" :"field grad not existing or of wrong type"
"grad(U)"
^^^^
--|



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!


Bernardo
beluiz93 is offline   Reply With Quote

Old   October 15, 2019, 15:56
Exclamation of4.1
  #2
New Member
 
Bernardo Ribeiro
Join Date: Aug 2016
Posts: 13
Rep Power: 9
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

Reply


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 07:35.