funkySetBoundaryFields - Manipulation of existing field
Hi everybody,
I would like to set a complex boundary condition at my Inlet (simple rectangular patch) with the funkySetBoundaryField utility. Instead of implementing an analytical expression depending on the spacial parameters pos().x and pos().y, I would like to manipulate an existing field. Actually, the implemented velocity field at the Inlet should represent a complex flow field of a fan. I therefore interpolated experimental data over the whole inlet. There are, however, additional effects on the flow field caused by the fan blades I cant display by a simple interpolation. Thats why I wanted to run the funkySetBoundaryField utility over the interpolated velocity field at the inlet. According to the contrib description of the funkySetField utility on the wiki page it should be possible to manipulate existing fields: "All the fields in the current time-step can be used. If the field is also the target field the old value is used. Then the field is written using the new value." So, does anybody know how to call by an "OldField value" within an expression? Such as pos().x is the syntax for the x position of the cell center. Thanks! |
Quote:
|
Thank you very much for your reply gschaider. Using the variable p in an expression works fine but unfortunately it doesnīt work with the variable U. The error message is that I use a non scalar value when I use e.g. the following expressions: "mag(U)" or "2*U". Isnīt the mag() function supposed to work for vector values as well as scalar values? And anyway there shouldnīt be any problem with the expression "2*U", which is just a scalar multiplication. Any ideas?
|
Quote:
"mag(U)" should evaluate to a scalar. "2*U" to a vector. Could you please post the funkySetBoundaryFieldDict (or whatever is the exact name)? |
Quote:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.1 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // velocities { field U; expressions ( //NOT working { target value; patchName INLET; expression "2*U"; } //Working // { // target value; // patchName INLET; // expression "pos().x>0.11 && pos().x<0.1583 ? vector(0.0,0.0,1.0) : vector(0.0,0.0,0.0)"; // } ); } ERROR MESSAGE: --> FOAM FATAL ERROR: No field of type scalar with the name "U" found |
Quote:
|
Problem using funky . . .
Dear Bernard
Hi I edit the funkysetboundaryfield to implement a simple velocity profile whatever I write it faces a parser error. could you please tell me what to do? Here is its dictionary: PHP Code:
Quote:
|
Quote:
|
After the fix the expressions work totally fine now. Thanks a lot!!!
|
Hello Bernard
I'm using funkysetfields to initialize a field with 4 different conditional statements, imagine a cylinder with four quadrants: Code:
Code:
{ Thanks, Carlos |
Quote:
Your problem is that there is no conditions-entry. I didn't add this as it would add some subtle problems if the entry is not currently present. There are two solutions I could think of. One would be a monster expression for all four quadrants. This is a sketch: "pos().x>0 ? (pos().y>0 ? v1 :v2) : (pos().y>0 ? v3 : v4)" (maybe variables can ease the pain here) The other possibility would be a sequence of expressions where you use the value of the field (but this would only work for the value-entry): "pos().x>0 && pos().y>0 ? v1 : vector(0,0,0)" "pos().x>0 && pos().y<=0 ? v2 : U" "pos().x<0 && pos().y>0 ? v3 : U" "pos().x<0 && pos().y<=0 ? v4 : U" But I'm not sure whether the field would have to be written to disc for this to work (or whether the cache-command-line-option is needed) |
Sorry Bernard, yes the second one is for funkysetboudary.
Thank you very much for your help. Carlos |
Hello,
Code:
/*--------------------------------*- C++ -*----------------------------------*\ |
Quote:
|
setup funkySetBoundaryDict
Hi,
I have modified the funkySetBoundaryDict for my problem and it is in the 'system' folder. but my program is not reading it. I have groovyBC installed and that works fine. I wonder if I have to add something like 'libsgroovyBC.so' in the controlDict file for the funkySetBoundary. Please suggest. Many thanks |
define Neumann boundary in funkySetBoundaryFiled
Hi,
How should I set up Neumann boundary condition using funkySetBounaryField? It seems like taking only Dirichlet boundary. Thanks |
parabolic profile at inlet
Quote:
I am trying to use funkySetBoundaryFieldDict to create a parabolic inlet profile but I am getting a plug flow even after introducing FSBF. Code:
velocities { |
All times are GMT -4. The time now is 07:54. |