|
[Sponsors] |
March 20, 2012, 13:41 |
|
#21 |
Senior Member
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 131
Rep Power: 15 |
[CODE]
inlet { type codedFixedValue; value $internalField; redirectType ramp; code #{ scalar U_0 = 0.003, scalar r = 0.025; fixedValueFvPatchField<vector> myPatch(this->Cf().size()); forAll(this->Cf(), i) { myPatch[i] = vector( 2*U_0*(1 - Foam:ow(this->Cf()[i].x(), 2) / r / r )),0,0); } (*this)== myPatch; #}; } I got the following error: Using dynamicCode for patch inlet on field U at line 25 in "/home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet" Creating new library in "dynamicCode/ramp/platforms/linux64GccDPOpt/lib/libramp_33868748d21fc6c5f633c2f3604861e34d0d7dc7.s o" Invoking "wmake -s libso /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/dynamicCode/ramp" wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file fixedValueFvPatchFieldTemplate.C /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet: In member function ‘virtual void Foam::rampFixedValueFvPatchVectorField::updateCoef fs()’: /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet:32: error: ‘class Foam::rampFixedValueFvPatchVectorField’ has no member named ‘Cf’ /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet:32: error: expected primary-expression before ‘)’ token /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet:32: error: expected ‘;’ before ‘)’ token /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet:33: error: ‘class Foam::rampFixedValueFvPatchVectorField’ has no member named ‘Cf’ /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet:33: error: ‘class Foam::rampFixedValueFvPatchVectorField’ has no member named ‘Cf’ /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet:33: error: expected ‘;’ before ‘)’ token make: *** [Make/linux64GccDPOpt/fixedValueFvPatchFieldTemplate.o] Error 1 --> FOAM FATAL IO ERROR: Failed wmake "dynamicCode/ramp/platforms/linux64GccDPOpt/lib/libramp_33868748d21fc6c5f633c2f3604861e34d0d7dc7.s o" file: /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet from line 25 to line 30. From function codedBase::createLibrary(..) in file db/dynamicLibrary/codedBase/codedBase.C at line 202. FOAM exiting |
|
March 20, 2012, 18:40 |
|
#22 |
Senior Member
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 18 |
hello,
there is a , instead of ; scalar U_0 = 0.003, But you probably found that already. all the best, Wouter |
|
March 21, 2012, 05:28 |
Error code: has no member named ‘Cf’
|
#23 |
Senior Member
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 131
Rep Power: 15 |
[CODE]
inlet { type codedFixedValue; value $internalField; redirectType ramp; code #{ scalar U_0 = 0.003; scalar r = 0.025; fixedValueFvPatchField<vector> myPatch(this->Cf().size()); forAll(this->Cf(), i) { myPatch[i] = vector( 2*U_0*(1 - Foamow(this->Cf()[i].x(), 2) / pow(r,2)),0,0); } (*this)== myPatch; #}; } I got the following error: /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet:32: error: ‘class Foam::rampFixedValueFvPatchVectorField’ has no member named ‘Cf’ /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet:33: error: ‘class Foam::rampFixedValueFvPatchVectorField’ has no member named ‘Cf’ /home/thermo/gsaha/OpenFOAM/gsaha-2.1.0/run/tutorials/incompressible/simpleFoam/parabolicflow/0/U::boundaryField::inlet:33: error: ‘class Foam::rampFixedValueFvPatchVectorField’ has no member named ‘Cf’ make: *** [Make/linux64GccDPOpt/fixedValueFvPatchFieldTemplate.o] Error 1 Thanks All |
|
March 22, 2012, 03:15 |
|
#24 | |
New Member
Join Date: Mar 2012
Posts: 12
Rep Power: 14 |
Greetings guys...
I want to apply a codedFixedValue to a 0/p for the inlet of an oscillatory flow... according to NS equation that p value should have something like p=-2*pi*f*U_m*cos(2*pi*f*t)x, so at left boundary x=-20 therefore this equation becomes p=-2*pi*f*U_m*cos(2*pi*f*t)*(-20). I want to realize that p BC by codedFixedValue as following: inlet { type codedFixedValue; value uniform 0; redirectType rampedFixedValue; code #{ operator==40*3.141*1*cos(3.141*0.5*this->db().time().value()); #}; } However I keep getting the following error msg: Quote:
|
||
March 22, 2012, 16:45 |
|
#25 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings November,
Quote:
Best regards, Bruno
__________________
Last edited by wyldckat; April 11, 2012 at 17:36. Reason: typo |
||
March 23, 2012, 01:16 |
|
#26 | |||
New Member
Join Date: Mar 2012
Posts: 12
Rep Power: 14 |
Quote:
I am trying to simulate a very easy problem - oscillatory flow around a circular cylinder (3D), however I got stuck for the inlet and outlet boundary conditions here... and have been searching the web for solutions but without luck.. so, I want a inlet velocity at u_x=U_m*sin(2*pi*f*t), U_m=1m/s, u_y=0, u_z=0. Therefore I have specified for the inlet and outlet BC in 0/u as followings: code: Quote:
Quote:
Specifying the BC of inlet and outlet for an oscillatory flow around a circular cylinder... It looks easy however I couldnt find an example as how people did it... I am really confused now...Could you give me some hints??? Thanks in advance!! |
||||
April 11, 2012, 12:18 |
|
#27 | |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Quote:
Had you any luck applying your BC???? Anyways, this works with me: Code:
this->patch().Cf() Hisham Last edited by Hisham; April 11, 2012 at 14:51. |
||
April 12, 2012, 06:22 |
|
#28 |
Senior Member
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 131
Rep Power: 15 |
I wrote the following code and now its working:
inlet { type codedFixedValue; value $internalField; redirectType ramp; code #{ scalar U_0=0.001934; scalar r=0.02595; fixedValueFvPatchVectorField myPatch(*this); forAll(this->patch().Cf(),i) { myPatch[i]=vector(2*U_0*(1-Foam:ow(this->patch().Cf()[i].x(),2)/r/r),0,0); } operator==(myPatch); #}; } Last edited by Goutam; April 13, 2012 at 07:45. |
|
September 6, 2012, 09:12 |
|
#29 |
New Member
|
Hi Friends,
I want to use codedFixedValue boundaryfield for boundary condition in Inlet for U. If I used constant value for equation it works but when I want to put values from another file it doesn't work. How can I force this patch-type for reading a constant from another file(e.g., include/initials)?? My code is: inlet { type codedFixedValue; redirectType velocity_inlet; code #{ scalar Ustar=$Ustar;; scalar k=0.42; scalar z0=2.25e-4; fixedValueFvPatchVectorField myPatch(*this); forAll(this->patch().Cf(),i) { myPatch[i]=vector(Ustar/k*(Foam::log((this->patch().Cf()[i].y()+z0)/z0)),0,0); } operator==(myPatch); #}; value $internalField; } and I get the error below: ‘Ustar’ was not declared in this scope Thanks a lot in advance. Ali |
|
September 14, 2012, 10:28 |
|
#30 |
New Member
ae-lab VUB
Join Date: Oct 2011
Posts: 17
Rep Power: 15 |
Hi
I am trying to make a ramped BC as mentioned above (Tomasso Lucchini's rampedFixedValue BC). It compiles, but when using it in the cavitycase I get this error: Foam::error:rintStack(Foam::Ostream&) in "/home/mvdtempe/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" Foam::sigSegv::sigHandler(int) in "/home/mvdtempe/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" Uninterpreted: void Foam::dot<Foam::Vector<double>, Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<Foam::inne rProduct<Foam::Vector<double>, Foam::Vector<double> >::type, Foam::fvsPatchField, Foam::surfaceMesh>&, Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/home/mvdtempe/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/icoFoam" at icoFoam.C:0 in "/home/mvdtempe/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/icoFoam" __libc_start_main in "/lib/i386-linux-gnu/libc.so.6" in "/home/mvdtempe/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/icoFoam" Segmentation fault (core dumped) ...? I use 2.1.x |
|
December 12, 2014, 06:43 |
|
#31 |
New Member
hello
Join Date: Nov 2014
Posts: 3
Rep Power: 12 |
I am trying to define a boundary condition, T(Temperature) will change with a Z(coordinates). But I don’t know ,which boundary should I user ,movingwall or front,etc;
I NEED HELP myPatch { type codedFixedValue; value uniform 0; redirectType myFixedValue; // name of generated BC code #{ forAll(*this, i) { scalar z = patch().Cf()[i][2]; if (z > 0 && z < 32) (*this)[i] = 0.0075 * z -1.58; else if (...) ...; else ...; } #}; codeInclude #{ #include "fvCFD.H" #}; codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude #}; |
|
December 12, 2014, 06:49 |
|
#32 |
New Member
|
@hesong
Why don't you use groovyBC!? For your B.C the groovyBC could be the best choice. |
|
December 12, 2014, 07:00 |
|
#33 |
New Member
hello
Join Date: Nov 2014
Posts: 3
Rep Power: 12 |
||
December 12, 2014, 07:08 |
|
#34 |
New Member
|
Using groovyBC for complex BCs is straightforward. You can search it in the forum and find a lot of resources on working with groovyBC and swak4FOAM:
https://openfoamwiki.net/index.php/Contrib/groovyBC https://openfoamwiki.net/index.php/Contrib/swak4Foam http://www.cfd-online.com/Forums/tags/groovybc.html http://www.cfd-online.com/Forums/ope...locity-bc.html I hope you can find your solution. |
|
April 23, 2015, 12:50 |
|
#35 |
Member
Mehtab
Join Date: Jan 2015
Posts: 41
Rep Power: 11 |
Hi Foamers,
I want to implement a boundary condition at inlet. 𝑇_𝑠=𝑇_0+1/𝐶_𝑝 [𝑄_𝑓/(𝑚*̇ " )*̇ −𝐻_𝑣𝑎𝑝 ] In this equation Q_f and 𝑚*̇ " need to be taken from inlet at previous time step. Is it possible to do it using grovyBC or codedFixedValue in Openfoam? Which one be easier to implement? Thanks in advance..... |
|
April 14, 2016, 03:51 |
|
#36 |
Senior Member
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 11 |
Hello everybody,
I am experimenting with #codestream and codedFixedValue boundary conditions. I was able to implement #codeStream successfully for the internalField. But I am having a lot of trouble with codedFixedValue. I can't even get the example code given in the documentation to work. The code is compiling without mistakes but when I view it in Paraview it is applying the value (uniform 0) that is specified for 'value'. Any idea why codedFixedValue does not work for me? By the way, I am using OF 2.1.1. Thank you very much. |
|
April 14, 2016, 07:08 |
|
#37 |
Senior Member
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 11 |
I want to try something advanced but I am not sure of OF syntax and such.I just want to clarify if this code is supposed to work. It is just setting some fixed value.
Code:
NOZZLE_INLET { type codedFixedValue; value uniform 400000; redirectType random; code #{ operator == (200000); #}; codeInclude #{ #include "fvCFD.H" #}; codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude #}; } Once again, thanks everyone. |
|
April 15, 2016, 19:10 |
|
#38 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick answer: Given how you coded it, the value is only updated in the first time step of the solver or at least when you run decomposePar.
__________________
|
|
April 16, 2016, 09:53 |
|
#39 |
Senior Member
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 11 |
Hi Bruno,
Thank you very much for replying me. Really appreciate you taking your time to help others. I used decomposePar and then reconstructPar to see if the changes take effect but there seems to be no change at all. The #code section is still being ignored. |
|
April 16, 2016, 17:27 |
|
#40 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi usv001,
Something very strange is going on here... at least in my machine. I would have to rebuild OpenFOAM 2.1.1 from source code to fix the problem on my side and I don't feel like it right now. There are two things I need to you test/check:
In addition to this, which Linux Distribution and version are you using? Best regards, Bruno
__________________
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Domain Imbalance | HMR | CFX | 5 | October 10, 2016 06:57 |
Can anyone give me some hint on how to make traction free boundary condition? | poplar | OpenFOAM | 3 | January 14, 2015 03:37 |
Boundary Conditions | Thomas P. Abraham | Main CFD Forum | 20 | July 7, 2013 06:05 |
Setting outlet Pressure boundary condition using CAFFA code | Mukund Pondkule | Main CFD Forum | 0 | March 16, 2011 04:23 |
How to set boundary condition in Fluent for the fo | Peiyong | FLUENT | 1 | November 10, 2006 12:44 |