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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2019, 16:27
Exclamation Can't use grad(U) in a swakExpression!
  #1
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:



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, 16:56
Exclamation of4.1
  #2
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

Reply

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


All times are GMT -4. The time now is 17:00.