[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::pow(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 |
hello,
there is a , instead of ; scalar U_0 = 0.003, But you probably found that already. all the best, Wouter |
Error code: has no member named ‘Cf’
[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:pow(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 |
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:
|
Greetings November,
Quote:
Best regards, Bruno |
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!! |
Quote:
Had you any luck applying your BC???? Anyways, this works with me: Code:
this->patch().Cf() Hisham |
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::pow(this->patch().Cf()[i].x(),2)/r/r),0,0); } operator==(myPatch); #}; } |
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 |
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 |
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 #}; |
@hesong
Why don't you use groovyBC!? For your B.C the groovyBC could be the best choice. |
Quote:
could you provide some detailed information I just learn this software for several months. |
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. |
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..... |
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. |
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 Once again, thanks everyone. |
Quote:
|
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. |
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 |
All times are GMT -4. The time now is 20:01. |