CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How could new B.C be compiled? (https://www.cfd-online.com/Forums/openfoam-solving/63282-how-could-new-b-c-compiled.html)

ttdtud April 3, 2009 03:49

How could new B.C be compiled?
 
Hi everybody,
i would like to change the standard B.C. "oscillatingFixedValue" to new one, "myOscillatingFixedValue". It can make B.C varies with two frequencies.
I have copied the standard dictiondary "oscillatingFixedvalue" and renamed it to "myOscillatingFixedValue". Everyword which begins with "oscillating" in the "oscillatingFixedValue" has been renamed to "myOscillatingFixedValue", and i have added "frequency2" in "myOscillatingFixedValue" wherever "frequency" appears, in the meantime the "frequency" has been renamed to "frequency1".
I have also created subdictionary "Make".
At last i have tried to compile it using "wmake libso", but it didnot succeed.
Can anybody tell me what should I do?
Every hint and advice would be appreciated gratefully.

cliffoi April 3, 2009 05:43

Hi, you're going to have to be a bit more specific on what you mean by "it did not succeed". The problem could be anything from not setting up your wmake files and options correctly to coding errors. Also note that you should have modified all 5 source code files myOscillatingFixedValueFvPatchField.C, myOscillatingFixedValueFvPatchField.H, myOscillatingFixedValueFvPatchFields.C, myOscillatingFixedValueFvPatchFields.H and myOscillatingFixedValueFvPatchFieldsFwd.H for the new boundary condition and your wmake files should reference myOscillatingFixedValueFvPatchFields.C.

ttdtud April 3, 2009 06:14

Hi Ivor, thanks for your answer.
yes, i have modified every source files.
And Make/files:
myOscillatingFixedValueFvPatchField.C
myOscillatingFixedValueFvPatchFields.C

LIB = $(FOAM_USER_LIBBIN) /libmyBCs

Make/options:
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = \

After compile using "wmake libso" , the following come:

~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:174: Warnung: Die Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden überschrieben
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:165: Warnung: Alte Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden ignoriert
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:183: Warnung: Die Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden überschrieben
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:174: Warnung: Alte Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden ignoriert
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:191: Warnung: Die Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden überschrieben
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:183: Warnung: Alte Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden ignoriert
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:174: Warnung: Die Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden überschrieben
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:165: Warnung: Alte Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden ignoriert
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:183: Warnung: Die Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden überschrieben
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:174: Warnung: Alte Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden ignoriert
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:191: Warnung: Die Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden überschrieben
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:183: Warnung: Alte Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden ignoriert
Making dependency list for source file myOscillatingFixedValueFvPatchField.C
could not open file fixedValueFvPatchFields.H for source file myOscillatingFixedValueFvPatchField.C
Making dependency list for source file myOscillatingFixedValueFvPatchFields.C
could not open file fixedValueFvPatchFields.H for source file myOscillatingFixedValueFvPatchFields.C
could not open file volFields.H for source file myOscillatingFixedValueFvPatchFields.C
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:174: Warnung: Die Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden überschrieben
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:165: Warnung: Alte Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden ignoriert
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:183: Warnung: Die Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden überschrieben
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:174: Warnung: Alte Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden ignoriert
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:191: Warnung: Die Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden überschrieben
~/OpenFOAM/OpenFOAM-1.4.1/wmake/Makefile:183: Warnung: Alte Befehle für das Ziel
~/OpenFOAM/hongyi-1.4.1/lib/linux64GccDPOpt« werden ignoriert
In file included from myOscillatingFixedValueFvPatchField.C:27:
myOscillatingFixedValueFvPatchField.H:39:37: error: fixedValueFvPatchFields.H: Datei oder Verzeichnis nicht gefunden
In file included from myOscillatingFixedValueFvPatchField.C:27:
myOscillatingFixedValueFvPatchField.H:53: error: expected template-name before ‘<’ token
myOscillatingFixedValueFvPatchField.H:53: error: expected `{' before ‘<’ token
myOscillatingFixedValueFvPatchField.H:53: error: expected unqualified-id before ‘<’ token
In file included from myOscillatingFixedValueFvPatchField.H:232,
from myOscillatingFixedValueFvPatchField.C:27:
myOscillatingFixedValueFvPatchField.C:38: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:53: error: expected ‘,’ or ‘...’ before ‘&’ token
myOscillatingFixedValueFvPatchField.C:55: error: ISO C++ forbids declaration of ‘fvPatch’ with no type
myOscillatingFixedValueFvPatchField.C:55: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:70: error: expected ‘,’ or ‘...’ before ‘&’ token
myOscillatingFixedValueFvPatchField.C:73: error: ISO C++ forbids declaration of ‘fvPatch’ with no type
myOscillatingFixedValueFvPatchField.C:73: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:87: error: expected ‘,’ or ‘...’ before ‘&’ token
myOscillatingFixedValueFvPatchField.C:90: error: ISO C++ forbids declaration of ‘fvPatch’ with no type
myOscillatingFixedValueFvPatchField.C:90: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:117: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:132: error: expected ‘,’ or ‘...’ before ‘<’ token
myOscillatingFixedValueFvPatchField.C:133: error: ISO C++ forbids declaration of ‘DimensionedField’ with no type
myOscillatingFixedValueFvPatchField.C:133: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:149: error: expected ‘,’ or ‘...’ before ‘&’ token
myOscillatingFixedValueFvPatchField.C:150: error: ISO C++ forbids declaration of ‘fvPatchFieldMapper’ with no type
myOscillatingFixedValueFvPatchField.C:150: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:160: error: expected ‘,’ or ‘...’ before ‘<’ token
myOscillatingFixedValueFvPatchField.C:162: error: ISO C++ forbids declaration of ‘fvPatchField’ with no type
myOscillatingFixedValueFvPatchField.C:162: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:174: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:195: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:38: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:53: error: expected ‘,’ or ‘...’ before ‘&’ token
myOscillatingFixedValueFvPatchField.C:55: error: ISO C++ forbids declaration of ‘fvPatch’ with no type
myOscillatingFixedValueFvPatchField.C:55: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:70: error: expected ‘,’ or ‘...’ before ‘&’ token
myOscillatingFixedValueFvPatchField.C:73: error: ISO C++ forbids declaration of ‘fvPatch’ with no type
myOscillatingFixedValueFvPatchField.C:73: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:87: error: expected ‘,’ or ‘...’ before ‘&’ token
myOscillatingFixedValueFvPatchField.C:90: error: ISO C++ forbids declaration of ‘fvPatch’ with no type
myOscillatingFixedValueFvPatchField.C:90: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:117: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:132: error: expected ‘,’ or ‘...’ before ‘<’ token
myOscillatingFixedValueFvPatchField.C:133: error: ISO C++ forbids declaration of ‘DimensionedField’ with no type
myOscillatingFixedValueFvPatchField.C:133: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:149: error: expected ‘,’ or ‘...’ before ‘&’ token
myOscillatingFixedValueFvPatchField.C:150: error: ISO C++ forbids declaration of ‘fvPatchFieldMapper’ with no type
myOscillatingFixedValueFvPatchField.C:150: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:160: error: expected ‘,’ or ‘...’ before ‘<’ token
myOscillatingFixedValueFvPatchField.C:162: error: ISO C++ forbids declaration of ‘fvPatchField’ with no type
myOscillatingFixedValueFvPatchField.C:162: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:174: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.C:195: error: invalid use of incomplete type ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
myOscillatingFixedValueFvPatchField.H:51: error: declaration of ‘class Foam::myOscillatingFixedValueFvPatchField<Type>’
make: *** [Make/linux64GccDPOpt/myOscillatingFixedValueFvPatchField.o] Fehler 1

Any advice?
Thank you very much!

cliffoi April 3, 2009 07:56

The clue is in:
could not open file fixedValueFvPatchFields.H for source file myOscillatingFixedValueFvPatchFields.C
could not open file volFields.H for source file myOscillatingFixedValueFvPatchFields.C

Seems that the compiler is not finding the OpenFOAM headers. look in the directory ${LIB_SRC}/finiteVolume/lnInclude and check that it contains the necessary linked headers. If the headers are missing you'll need to use the wmakelnInclude script to add them.

Also, if I'm not mistaken you should remove myOscillatingFixedValueFvPatchField.C from your Make/files

ttdtud April 3, 2009 08:53

1 Attachment(s)
Yes, the both header-files are over there. And i have also removed the "myOscillatingFixedValueFvPatchField.C" from "Make/files".
At last i have tried to compile it and everything as same as last time happened again.

I have uploaded my files, if you have time would you kindly look at it?
Thanks a lot for your help!

cliffoi April 3, 2009 09:47

Use the wclean utility and then try to compile again. Worked on my machine.

ttdtud April 3, 2009 10:32

It is weird. Actually i have done many times using "wclean " after every compile before you told me.
The fact is that i received same error message as normal after every attempt.
Any other advice?
Thanks!

cliffoi April 3, 2009 10:49

Remove all the commented lines from Make/options as well as the space between LIB = $(FOAM_USER_LIBBIN) and /libmyBCs in Make/files

cliffoi April 3, 2009 10:51

Oh, and you'll need to link libfiniteVolume as well, so just uncomment that line. Make/files then becomes:
myOscillatingFixedValueFvPatchFields.C

LIB = $(FOAM_USER_LIBBIN)/libmyBCs

Make/options becomes:
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = \
-lfiniteVolume

ttdtud April 3, 2009 11:07

It works.
Thank you very much!
Have a nice weekend!!!


All times are GMT -4. The time now is 16:05.