CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Changing the name of a boundary condition produces errors (http://www.cfd-online.com/Forums/openfoam-bugs/83411-changing-name-boundary-condition-produces-errors.html)

jorkolino December 27, 2010 17:09

Changing the name of a boundary condition produces errors
 
Hi,

when I try to recompile a boundary condition from the OF sources by just changing its name as a parameter in the makePatchTypeFieldsTypedefs() and makePatchFIelds() functions, I get following errors when executing wmake libso :

error: expected initializer before '<' token.
error: expected initializer before '<' token.
error: expected initializer before '<' token.
................
error: 'mixedFvPatchScalarField' has not been declared
error: 'mixedFvPatchScalarFIeld' was not declared in this scope
...................
error: 'mixedFvPatchVectorFIeld' ...

The boundary condition otherwise compiles well when using the original name (in this case mixed). I tried replacing the name with many allowed names, including such that are present in OF (like fixedValue), with the same error message.

wyldckat January 5, 2011 22:25

Greetings George,

It's not advisable to change boundary conditions in the core libraries of OpenFOAM. It's best to create a new library for adding a new boundary condition.

Secondly, "mixedFvPatchScalarField" and "mixedFvPatchScalarFIeld" are Not the same thing, in the eyes of the compiler!! C/C++ is case sensitive, requiring the user to be very cautious of what he or she is doing! Same goes for CFD ;)

For more information on how to add a new boundary condition, see this page in the unofficial wiki: HowTo Adding a new boundary condition

Best regards and good luck!
Bruno

jorkolino January 6, 2011 04:14

Hi,

thanks for reply. I had a problem compiling my own library, the problem turned out to be that the file names did not follow a particular syntax: mainly that the name of the B.C. should be the same as the file name prefix before fvPtchField. I.e. if i want a B.C called mixedGeorge, then my file names shoud be mixedGeorgefvPatchField[s].C[H]. Just changing the file names helped to solve the issue. The word "...FIeld.." in my message above was just a typo in the forum.

Regards,
George


All times are GMT -4. The time now is 06:42.