|
[Sponsors] |
Getting errors on compiling boundary condition |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 9, 2012, 03:32 |
Getting errors on compiling boundary condition
|
#1 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 14 |
hi,
i am new to openfoam so please bear with me if my doubt is silly. i was trying to use new boundary condition by modifying oscillatingFixedValue , so i copied it to my OpenFoam/shash-2.1.1/run/pitzdaily/ and made a make dir. in which i modified make/files to newoscillatingFixedValueFvPatchField.C EXE = $(FOAM_USER_APPBIN)/newoscillatingFixedValueFvPatchField then wclean rm -rf Make/linux* wmake but its showing error : ************************************************ Making dependency list for source file newoscillatingFixedValueFvPatchField.C SOURCE=newoscillatingFixedValueFvPatchField.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/shash/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/shash/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/home/shash/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/newoscillatingFixedValueFvPatchField.o In file included from newoscillatingFixedValueFvPatchField.H:242:0, from newoscillatingFixedValueFvPatchField.C:3: newoscillatingFixedValueFvPatchField.C: In member function ‘virtual void Foam::newoscillatingFixedValueFvPatchField<Type>:: updateCoeffs()’: newoscillatingFixedValueFvPatchField.C:180:27: error: there are no arguments to ‘patch’ that depend on a template parameter, so a declaration of ‘patch’ must be available [-fpermissive] newoscillatingFixedValueFvPatchField.C:180:27: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) newoscillatingFixedValueFvPatchField.C:184:38: error: there are no arguments to ‘patch’ that depend on a template parameter, so a declaration of ‘patch’ must be available [-fpermissive] newoscillatingFixedValueFvPatchField.C: At global scope: newoscillatingFixedValueFvPatchField.C:14:8: error: redefinition of ‘Foam::scalar Foam::newoscillatingFixedValueFvPatchField<Type>:: currentScale() const’ newoscillatingFixedValueFvPatchField.C:14:8: error: ‘Foam::scalar Foam::newoscillatingFixedValueFvPatchField<Type>:: currentScale() const’ previously declared here newoscillatingFixedValueFvPatchField.C:27:1: error: redefinition of ‘Foam::newoscillatingFixedValueFvPatchField<Type>: :newoscillatingFixedValueFvPatchField(const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&)’ newoscillatingFixedValueFvPatchField.C:27:1: error: ‘Foam::newoscillatingFixedValueFvPatchField<Type>: :newoscillatingFixedValueFvPatchField(const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&)’ previously declared here newoscillatingFixedValueFvPatchField.C:46:1: error: redefinition of ‘Foam::newoscillatingFixedValueFvPatchField<Type>: :newoscillatingFixedValueFvPatchField(const Foam::newoscillatingFixedValueFvPatchField<Type>&, const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)’ newoscillatingFixedValueFvPatchField.C:46:1: error: ‘Foam::newoscillatingFixedValueFvPatchField<Type>: :newoscillatingFixedValueFvPatchField(const Foam::newoscillatingFixedValueFvPatchField<Type>&, const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)’ previously declared here can someone please help me what am i doing wrong . |
|
June 9, 2012, 09:28 |
|
#2 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Hi Shash
First of all I think the question should be under the development section of OF forum (to enhance probability of getting help). Nonetheless, you have a punch of problems: 1. You have not made your homework. You need to read/re-read chapter3 of the user manual. 2. You may need a little brushing on your C++ skills. This place is fantastic. You seem to declare parameters more than once and you need to read about templating a little bit the thing<thingy> thing 3. So you need to do the 1st 2 steps then you can have a question that can actually be answered I wish these points help you (you'll know they help when you do them)! Good luck Hisham |
|
June 10, 2012, 06:51 |
|
#3 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 14 |
hi hisham,
thanks for ur quick reply , i hav already read user guide and hav well enough knowledge of templating , i suppose there is some problem with installation of my compiler as -fpermissive is not enabled (shown in error). i am also attaching my modified code could you please hav a look and suggest the mistake. my task is to develop velocity profile at inlet v=v0(1+ sin(t)) ;v0 being parabolic f(y). |
|
June 10, 2012, 06:59 |
|
#4 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Why not give the codedFixedValue BC a try. I'll try to look at your BC.
Edit: from the error message and before going into code. You have a object of a class that needs definition of a template. You also have re-declared several variables. The wmake utility makes life much easier (i.e. you do not need to change arguments to your compiler unless you need -pipe to speed compilation for example or you link to some library). |
|
June 10, 2012, 15:31 |
|
#5 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 14 |
hi hisham,
I think coded bc will work in my case , i have read a blog by you and wrote this code snippet, not sure abt suntax of (ux,0,0) inlet { type codedFixedValue; value uniform (0 0 0); redirectType para_osc_bc; code #{ fixedValueFvPatchVectorField myPatch (*this); forAll(myPatch, celli) { myPatch[celli] =vector((.1*(1-(this->patch().Cf()[celli](1)*this->patch().Cf()[celli](1)/.01))*(1 + sin(this->db().time().value()))),0,0); } operator==(myPatch); #}; } |
|
June 10, 2012, 15:44 |
|
#6 | |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Quote:
To get the sin it is better (I think also necessary) to write it as: Code:
Foam::sin(this->db().time().value()) if this is what you aim then I guess you have done it or else you may need to define some variable or two to make the code easier to read ... e.g: Code:
scalar helpVariable(1+Foam::sin(...)); |
||
June 10, 2012, 16:45 |
|
#7 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 14 |
hi,
added Foam::sin yet getting this error from it /home/shash/OpenFOAM/shash-2.1.1/run/pitzDaily/0/U::boundaryField::inlet: In member function ‘virtual void Foam:: para_osc_bcFixedValueFvPatchVectorField::updateCoe ffs()’: /home/shash/OpenFOAM/shash-2.1.1/run/pitzDaily/0/U::boundaryField::inlet:33:77: error: no match for call to ‘(const Foam::Vector<double>) (int)’ /home/shash/OpenFOAM/shash-2.1.1/run/pitzDaily/0/U::boundaryField::inlet:33:108: error: no match for call to ‘(const Foam::Vector<double>) (int)’ |
|
June 10, 2012, 17:26 |
|
#8 | |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Quote:
|
||
June 10, 2012, 17:40 |
|
#9 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 14 |
hi hisham,
my U file: FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type codedFixedValue; value uniform (0 0 0); //$internalField; redirectType awsum_bc; code #{ scalar U_0 = 0.1, c = .01 , a = 1, f = 1 ; // Values you need fixedValueFvPatchField<vector> myPatch (*this); forAll(myPatch, celli) { myPatch[celli] = Foam::vector((U_0*(1- this->patch().Cf()[celli](1) * this->patch().Cf()[celli](1)/c)*(1 + a * Foam::sin(f*this->db().time().value())),0,0); } operator==(myPatch); #}; } outlet { type zeroGradient; } upperWall { type fixedValue; value uniform (0 0 0); } lowerWall { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } } |
|
June 10, 2012, 18:21 |
|
#11 |
Member
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 14 |
its working finally , THANK YOU HISHAM
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 60 | July 17, 2024 06:45 |
asking for Boundary condition in FLUENT | Destry | FLUENT | 0 | July 27, 2010 01:55 |
External Radiation Boundary Condition for Grid Interface | CFD XUE | FLUENT | 0 | July 9, 2010 03:53 |
how to set up a wall boundary condition according to calculated wall shear stress? | gameoverli | OpenFOAM Pre-Processing | 1 | May 21, 2009 09:28 |
How to set boundary condition in Fluent for the fo | Peiyong | FLUENT | 1 | November 10, 2006 12:44 |