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/)
-   -   adding linearValveLayersFvMesh to library in OF1.7.1 (https://www.cfd-online.com/Forums/openfoam-solving/83574-adding-linearvalvelayersfvmesh-library-of1-7-1-a.html)

AlexDeloffre January 4, 2011 08:05

adding linearValveLayersFvMesh to library in OF1.7.1
 
Hi everyone, happy new year!:)

I am working with OpenFOAM 1.7.1 and I have noticed that the "topoChangerFvMesh" library does not include the "linearValveLayersFvMesh" model.
In src/topoChangerFvMesh/make/files several .C files are in comment:

topoChangerFvMesh/topoChangerFvMesh.C
rawTopoChangerFvMesh/rawTopoChangerFvMesh.C

/*
linearValveFvMesh/linearValveFvMesh.C
linearValveLayersFvMesh/linearValveLayersFvMesh.C
*/

movingConeTopoFvMesh/movingConeTopoFvMesh.C
/*
mixerFvMesh/mixerFvMesh.C
*/


LIB = $(FOAM_LIBBIN)/libtopoChangerFvMesh

Because I need this feature I have removed */ and recompiled the library using "wmake libso".
The "mixerFvMesh.C" was correctly added but "linearValveLayersFvMesh" and "linearValveFvMesh" were not added.
For "linearValveLayersFvMesh" I get the following error message:

wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file linearValveLayersFvMesh/linearValveLayersFvMesh.C
SOURCE=linearValveLayersFvMesh/linearValveLayersFvMesh.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude -I/opt/openfoam171/src/dynamicFvMesh/lnInclude -I/opt/openfoam171/src/dynamicMesh/lnInclude -I/opt/openfoam171/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/linearValveLayersFvMesh.o
linearValveLayersFvMesh/linearValveLayersFvMesh.C: In member function ‘void Foam::linearValveLayersFvMesh::addZonesAndModifier s()’:
linearValveLayersFvMesh/linearValveLayersFvMesh.C:207: error: ‘addTopologyModifiers’ was not declared in this scope
linearValveLayersFvMesh/linearValveLayersFvMesh.C: At global scope:
linearValveLayersFvMesh/linearValveLayersFvMesh.C:372: error: prototype for ‘void Foam::linearValveLayersFvMesh::update()’ does not match any in class ‘Foam::linearValveLayersFvMesh’
linearValveLayersFvMesh/linearValveLayersFvMesh.H:105: error: candidate is: virtual bool Foam::linearValveLayersFvMesh::update()
make: *** [Make/linuxGccDPOpt/linearValveLayersFvMesh.o] Erreur 1

According to my observation of the others .C and the log I have change "void" to "bool" line 372 of the .C and add "topoChanger_." in front of addTopologyModifiers(tm)".
The new errors appear:

Making dependency list for source file linearValveLayersFvMesh/linearValveLayersFvMesh.C
SOURCE=linearValveLayersFvMesh/linearValveLayersFvMesh.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude -I/opt/openfoam171/src/dynamicFvMesh/lnInclude -I/opt/openfoam171/src/dynamicMesh/lnInclude -I/opt/openfoam171/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/linearValveLayersFvMesh.o
linearValveLayersFvMesh/linearValveLayersFvMesh.C: In member function ‘virtual bool Foam::linearValveLayersFvMesh::update()’:
linearValveLayersFvMesh/linearValveLayersFvMesh.C:381: error: ‘resetMorph’ was not declared in this scope
linearValveLayersFvMesh/linearValveLayersFvMesh.C:382: error: ‘setMorphTimeIndex’ was not declared in this scope
linearValveLayersFvMesh/linearValveLayersFvMesh.C:383: error: no matching function for call to ‘Foam::linearValveLayersFvMesh::updateMesh()’
/opt/openfoam171/src/finiteVolume/lnInclude/fvMesh.H:299: note: candidates are: virtual void Foam::fvMesh::updateMesh(const Foam::mapPolyMesh&)
linearValveLayersFvMesh/linearValveLayersFvMesh.C:394: error: ‘resetMorph’ was not declared in this scope
linearValveLayersFvMesh/linearValveLayersFvMesh.C:395: error: ‘setMorphTimeIndex’ was not declared in this scope
linearValveLayersFvMesh/linearValveLayersFvMesh.C:396: error: no matching function for call to ‘Foam::linearValveLayersFvMesh::updateMesh()’
/opt/openfoam171/src/finiteVolume/lnInclude/fvMesh.H:299: note: candidates are: virtual void Foam::fvMesh::updateMesh(const Foam::mapPolyMesh&)
linearValveLayersFvMesh/linearValveLayersFvMesh.C:398: error: ‘topoChangeMap’ was not declared in this scope
linearValveLayersFvMesh/linearValveLayersFvMesh.C:417: error: no matching function for call to ‘Foam::linearValveLayersFvMesh::updateMesh()’
/opt/openfoam171/src/finiteVolume/lnInclude/fvMesh.H:299: note: candidates are: virtual void Foam::fvMesh::updateMesh(const Foam::mapPolyMesh&)
linearValveLayersFvMesh/linearValveLayersFvMesh.C:424: warning: no return statement in function returning non-void
make: *** [Make/linuxGccDPOpt/linearValveLayersFvMesh.o] Erreur 1

There are three declaration problems:
resetMorph
setMorphTimeIndex
updateMesh
topoChangeMap
What is odd is that resetMorph and setMorphTimeIndex appear once again after the line 396 but only updateMesh is mentioned. :confused:
I have solved the last problem by adding a line I saw in the "mixerFvMesh.C" and above in linearValveLayersFvMesh.C:
autoPtr<mapPolyMesh> topoChangeMap = topoChanger_.changeMesh(true)
How could I solve those problem?
Thank you very much. :)

Here is the linearValveLayersFvMesh.C

hjasak January 8, 2011 07:12

Basically, you need to switch to 1.6-ext: all if this is neither developed nor supported by OpenCFD and it is written by me.

If you try to retro-fit, you will hit the several hundred bug fixes that are missing as well.

Hope this helps,

Hrv

P.S. From what I hear, OpenCFD claim this is "future capability", presumably looking for people to pay them to take my code (available for free) and charge for it as a "development project". Hopefully Jenya Collins will log into the Forum and give us all a formal response.

Peter_600 January 8, 2011 07:41

I was following this thread and think my question fits here.
Since you wrote the topochangerenginemesh class I refer to you (Mr. Jasak).
I would like to use the dieselEngineFoam solver with topochangerenginemesh capability. I wouldlike to use with this solver for instance the accordionenginemesh class for canted valves. How can I adpat it for 1.5-dev and 1.6-ext?
I appreciate your help.
Peter

AlexDeloffre January 8, 2011 07:51

Thank you very much Hrv. In deed I was looking for your answer.
I am afraid I can't switch to the 1.6-ext before the end of my internship but you gave me enough informations to explain my problem.
Thank you.

P.S. I will wait for the answer of Jenya Collins.

hjasak January 8, 2011 10:09

:) thanks.

This is what you do: you can easily port the top-level code, there is full compatibilty there. If you need an example, the closest code in 1.6-ext is engineDyMFoam. It *may* already do what you want. The credit for the solver goes to the Milan Boys - if you speak to Tommaso after giving it a try, he can point you in the right direction.

On my side, I promise to merge in the contributions from 1.7.1 asap. There is some Windows work cooking, but we are under control.

Hrv

Peter_600 January 8, 2011 13:50

Thank you very much. I will check the engineDyMFoam solver. Nevertheless, I noticed a problem with dieselFoam (OF-1.6-ext) I think you also contribute to this extend version. The tutorial aachenbomb doesn t run to the end. It crashes very early wit the error janaf temp out of range. This is weird. I really would like to use this solver, too. Do you know to whom I can refer for this problem. I think there is something particular wrong with this solver. Other people also noticed that.

Peter


All times are GMT -4. The time now is 02:50.