|
[Sponsors] |
November 14, 2012, 18:41 |
|
#21 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
About flip(): you only need that on faceSets and faceZones. On patches the orientation of the faces is defined (all looking "in") and therefor flip() is not implemented for patches
__________________
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 |
||
December 6, 2012, 14:13 |
|
#22 |
Member
Brock Lee
Join Date: Sep 2012
Location: Midwest
Posts: 40
Rep Power: 14 |
Looks like he is missing some semicolons after the patch name? Try that, i think it might solve your problem aerogt3.
|
|
December 6, 2012, 14:35 |
|
#23 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Right. I never look for the obvious. Nevertheless: it is strange that it "found" the expression that way
__________________
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 |
|
December 12, 2012, 13:00 |
|
#24 | |
Member
Join Date: Mar 2009
Posts: 90
Rep Power: 17 |
Quote:
On a faceZone however, I am not able to do it. I get the error: Code:
Could not find a field name "p" of type scalar (neither surfaceScalarField nor volScalarField) Autointerpolate: 0 |
||
December 12, 2012, 13:56 |
|
#25 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 |
||
December 12, 2012, 16:11 |
|
#26 | |
Member
Join Date: Mar 2009
Posts: 90
Rep Power: 17 |
Quote:
|
||
December 12, 2012, 17:17 |
|
#27 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Well. Without it computations on faceZones/Sets wouldn't make much sense, would they It is not set by default so that users at least in theory acknowledge the fact that this is not the "real" value but only an approximation
__________________
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 |
|
December 13, 2012, 11:58 |
|
#28 | |
Member
Join Date: Mar 2009
Posts: 90
Rep Power: 17 |
Quote:
I think it's relevant to this thread, but is it possible to calculate the integral of a scalar field's gradient over a cellZone? I have tried below, but it's not working. Perhaps a matter of syntax, or maybe am I attempting something that's not possible? Code:
functions ( grad_integral { type swakExpression; valueType cellZone; zoneName fluid_2; accumulations ( sum ); expression "grad(p)*vol()"; verbose true; } ); |
||
December 13, 2012, 12:55 |
|
#29 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 |
||
December 13, 2012, 13:09 |
|
#30 | |
Member
Join Date: Mar 2009
Posts: 90
Rep Power: 17 |
Quote:
Code:
Expression grad_integral : --> FOAM FATAL ERROR: Parser Error at "1.1-4" :"field grad not existing or of wrong type" "grad(p)*vol()" " ^^^^ " From function parsingValue in file lnInclude/CommonValueExpressionDriverI.H at line 802. FOAM exiting |
||
December 13, 2012, 17:29 |
|
#31 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
a) reimplement major parts of OF to work on sets and zones. Too much work (unless somebody pays for it) b) calculate a temporary field "grad(p)". Get the relevant values from it. Throw it away. Could be done but would have major performance implications "grad(p)+grad(p)" in a 100 cell cellZone of a million cell case would mean that the gradient is calculated twice for the whole mesh (and because of the transparent handling it is not obvious to the user why this is so slow). So: no The proposed workaround is to use expressionField to generate a field gradP with the value "grad(p)" and calc "gradP*vol()" on the zone. gradP is still calculated on the whole mesh, but the user is aware of it and he can even reuse the field in other calculations
__________________
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 |
||
July 3, 2015, 00:32 |
swakExpression error
|
#32 |
Senior Member
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 17 |
Hi,
I am a new OpenFoam user. I have modeled a single droplet falling in air and I want to calculate its velocity. So I used the following expression at the end of controlDict: functions { downAverage { type swakExpression; valueType internalField; variables ( "downDirection=vector(0,-1,0);" "thres=0.5;" "liquidVol=sum(alpha.water>thres ? vol() : 0);" "downVel=alpha.water>thres ? (U & downDirection) : 0;" ); expression "downVel*vol()/liquidVol"; accumulations ( sum ); verbose true; } } But the following error appeared: --> FOAM FATAL ERROR: Unknown function type swakExpression Valid functions are : 4 ( patchProbes probes sets surfaces ) From function functionObject::New(const word& name, const Time&, const dictionary&) in file db/functionObjects/functionObject/functionObject.C at line 92. FOAM exiting I will really appreciate if you could tell me your idea to fix it. Regards, Elham |
|
July 13, 2015, 04:02 |
|
#33 | |
New Member
Silvan
Join Date: Jun 2014
Posts: 12
Rep Power: 12 |
Did you run updateSharedLibraries?
Did you include the swak libraries in the controlDict? please see http://www.cfd-online.com/Forums/ope...tml#post552461 Quote:
|
||
October 14, 2015, 23:11 |
|
#34 | ||
New Member
Dasein
Join Date: Mar 2015
Posts: 21
Rep Power: 11 |
Hi Everyone,
I am trying to calculate area weighted average velocities on a certain level above the floor height. To do that I use the following topoSet dictionary: Quote:
Quote:
If anyone has used swak4foam for this before I'd be obliged if you pitched in. Thank you in advance! Kind regards, Theodore. |
|||
October 16, 2015, 01:23 |
|
#35 |
New Member
Dasein
Join Date: Mar 2015
Posts: 21
Rep Power: 11 |
And one more question if I may. I looked around for this but couldn't find an answer. It is related to my very bad knowledge of C++ and coding in general but should be a novice question for the experienced people on this board.
I have a big number of faceZones I want to calculate parameters for. Is there a way to list all the faceZones in one zoneName parameter? I tried the typical C++ list but wouldn't work. If this is possible, would it still create different post processing text files (I would prefer this)? Furthermore, is there a way to list a number of expressions in one object? I would like to get the results of multiple parameters in one file instead of separate. Thank you so much in advance and excuse my novice questions. Kind regards, Theodore. |
|
October 21, 2015, 00:55 |
|
#36 | |
New Member
Dasein
Join Date: Mar 2015
Posts: 21
Rep Power: 11 |
Hello again, I seem to have another issue although this is not related to swak4foam.
I am using the topoSet to acquire the faceZoneSets in which I want to use swak4foam to calculate my average velocity. I have one surface stl for each of the faceZones (imagine this is a plane 1.2m above the floor of my building in the model). However, when I use foamToVTK to preview these zones, after they have been generated, I get a collection of cells that is ALL over the place and really nowhere near to where the surface is. The options I used are below: Quote:
I should also stress that I already used includeInside true without much success. Is there something terribly wrong in my code or is it just a visualization problem? I'd appreciate any wisdom Kind regards, Theodore. |
||
October 27, 2015, 10:30 |
How to calculate the sum of energy for a given zone?
|
#37 |
Member
Xiantao Zhang
Join Date: Nov 2014
Posts: 31
Rep Power: 12 |
I use openfoam to simulate waves.
For example, the length of numerical wave tank is 20m, and from 15 to 20m is the damping zone. I want to calculate the whole energy in the zone from 0 to 15m. Does anyone know how to do this? |
|
Tags |
openfoam 1.7.1, patchaverage, porous modellling, sampledict |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to calculate a time average | spwater | OpenFOAM | 2 | February 24, 2010 09:04 |
Problem in IMPORT of ICEM input file in FLUENT | csvirume | FLUENT | 2 | September 9, 2009 02:08 |
calculate the average velocity of particles | robert | FLUENT | 0 | August 1, 2008 10:44 |
Error to re-open fluent case file | J.Gimbun | FLUENT | 0 | April 27, 2006 09:42 |
Sliding mesh error | Karl Kevala | FLUENT | 4 | February 21, 2001 16:52 |