|
[Sponsors] |
October 26, 2011, 12:01 |
Error with codedFixedValue BC
|
#1 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Hi Foamers,
I want to use the codedFixedValue to set boundary conditions for a volScalarField to be 0 if the Y-Co larger than 2.5 and 1 otherwise. I tried this code: Code:
BoundaryName { type codedFixedValue; value uniform 0; redirectType initialWaterSurf; code #{ forAll(this, i) {operator== ((this[i]->y() > 2.5)? 0 : 1 )} #}; } Which includes should I have as well? By the way the error I get is: Code:
Setting internal values of volScalarField alpha1 --> FOAM FATAL IO ERROR: Loading a shared library using case-supplied code is not enabled by default because of security issues. If you trust the code you can enable this facility be adding to the InfoSwitches setting in the system controlDict: allowSystemOperations 1 The system controlDict is either ~/.OpenFOAM/$WM_PROJECT_VERSION/controlDict or $WM_PROJECT_DIR/etc/controlDict Best Regards, Hisham |
|
October 28, 2011, 05:39 |
|
#2 | |
Member
Jim Knopf
Join Date: Dec 2010
Posts: 60
Rep Power: 15 |
Quote:
i'm not sure aboute code fixed Value stuff but it seems to me that there are two Operators in your equation. The first is the equal introduced after operator and then there is the operator > before the 2.5 maybe you have to check the syntax Greetz Jim |
||
October 28, 2011, 05:58 |
|
#3 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Hi Jim,
I appreciate your answer. I think I need more tutorials on the codedBC. The only available one, is in its header file: Code:
code #{ operator==(min(10, 0.1*this->db().time().value())); #}; I had a workaround for my problem. Nevertheless, the coded BC is a nice tool to have by one's side. Regards Hisham |
|
January 11, 2012, 01:20 |
|
#4 |
Member
bruce
Join Date: May 2009
Location: Germany
Posts: 42
Rep Power: 17 |
hi,
codedFixedValue is like other inherited from fixedValueFvPatchField<> I tested this below code for pitzDaily , simpeFoam solver. U = 100 * y^2; Code:
inlet { type codedFixedValue; value uniform (0 0 0); redirectType rampedFixedValue; code #{ // flow direction vector sys = vector(1, 0, 0); // co-ord direction of a patch vector dir = vector(0, 1, 0); // variable to be evaluated scalarField var = patch().Cf() & dir; // evaluated value scalarField value = 100 * var * var; operator==( value * sys); #}; } |
|
March 22, 2012, 02:57 |
|
#5 |
New Member
Join Date: Mar 2012
Posts: 12
Rep Power: 14 |
Hi Bruce,
If I want to apply the codedfixedValue under icoFoam application, do I need to do something extra, like adding some library and recompiling??? Thanks. |
|
March 13, 2013, 22:50 |
|
#6 |
Member
Amir Abbas Aliabadi
Join Date: Mar 2013
Posts: 33
Rep Power: 13 |
The error message can be fixed by flagging "allowSystemOperations" in controlDict under /openfoam211/etc system directory. You should simply change it to 1 from 0. If permission is denied since you have installed OpenFoam under root directory then go to the above directory and type:
$ sudo gedit controlDict This enables you to change the setting and save the file. |
|
Tags |
codedfixedvalue |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
codedFixedValue boundary condition | wolfindark | OpenFOAM Pre-Processing | 50 | August 29, 2020 05:46 |