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 |
Quote:
|
Quote:
|
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 |
Quote:
|
Quote:
|
Quote:
|
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 |
Quote:
|
Quote:
Code:
Expression grad_integral : |
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 |
swakExpression error
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 |
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:
|
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. |
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. |
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. |
How to calculate the sum of energy for a given zone?
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? |
All times are GMT -4. The time now is 08:25. |