|
[Sponsors] |
October 28, 2014, 09:58 |
expressionField
|
#1 |
Senior Member
Join Date: Nov 2012
Location: Bavaria
Posts: 145
Rep Power: 13 |
Hi All,
I've a question about expressionField (,already discussed in other threads. discussion, example from above) Version 1: Code:
functions { yPlusField {type expressionField; outputControl timeStep; outputInterval 1; fieldName yPlus; expression "pow(0.09,0.25)*sqr(k)*nearDist()/mu"; autowrite true; } yPlusWall { type patchExpression; expression "pow(0.09,0.25)*sqr(k)*dist()/mu"; accumulations ( min max average ); patches (wall); verbose true; } } Version 2 Code:
functions { yPlusField { type expressionField; outputControl timeStep; outputInterval 1; fieldName yPlus; expression "pow(0.09,0.25)*sqr(k)*nearDist()/mu"; autowrite true; } yPlusWall { type patchExpression; expression "yPlus"; accumulations ( min max average ); patches (wall); verbose true; } } Creating expression field yPlus... type:volScalarField (but no scalar) and... Expression compute_yPlus on bottom: average=0 sum=0 Is Version 1 the only possibility to write the result in the log-File? Aylalisa |
|
October 28, 2014, 18:42 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Anyway: variation 1 is better anyway. a) because it only has to be computed on the boundary. Not on the whole field b) you get yPlus for the face. Not the value of the cell projected onto the face. Which might differ (think of a stretched cell in a corner: all three boundary faces of that cell will get the same value. Although they don't have the same yPlus) There is another way to calculate that. You could use the readAndUpdateField-functionObject to load a field myYPlus. In that field you implement the expression from version 1 as a groovyBC. Then you can use the patchExpression from version 2. The only advantage of this is that afterwards you have the whole field on disc and can visualize the distribution of yPlus in paraView
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] Trouble accessing fields within expressionField | aerogt3 | OpenFOAM Post-Processing | 6 | May 12, 2017 16:02 |
how to initalize an expressionField for the walldistance? | david112 | OpenFOAM Pre-Processing | 1 | March 23, 2017 03:23 |
[swak4Foam] Using fieldAverage together with swak4foam expressionField | tiam | OpenFOAM Community Contributions | 33 | December 18, 2016 08:49 |
[swak4Foam] swakFoam - expressionField | marluc | OpenFOAM Community Contributions | 1 | April 22, 2015 13:50 |
Problems creating a volScalarField with expressionField function-object | zfaraday | OpenFOAM Running, Solving & CFD | 2 | January 12, 2015 08:49 |