CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How to set up an own solver

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 7, 2015, 06:34
Default How to set up an own solver
  #1
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 10
Gerrit is on a distinguished road
Hi,

I wanted to follow this manual to customize a simpleFoam solver. I followed it as far as possible, but as soon as enter wmake I receive this:

Code:
make: *** No rule to make target `simpleFoam.dep', needed by `Make/linux64GccDPOpt/dependencies'.  Stop.
Does anyone know what to do?

In my folders is no simpleFoam.dep file.


I am using OpenFoam 2.4 on Ubuntu 14.04.

Did someone experienced that already?

Thanks
Gerrit
Gerrit is offline   Reply With Quote

Old   September 7, 2015, 06:54
Default
  #2
Senior Member
 
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 13
huangxianbei is on a distinguished road
try: wclean and then wmake
This is usually caused by the existing of the old .dep file.
huangxianbei is offline   Reply With Quote

Old   September 7, 2015, 06:58
Default
  #3
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 10
Gerrit is on a distinguished road
Thanks for the answer, but still the same...
Gerrit is offline   Reply With Quote

Old   September 7, 2015, 08:39
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Since usually "I wanted to follow this manual to customize a simpleFoam solver" and the error after means "I missed certain step", my guess will be: your Make/files file still contains simpleFoam.C but you have renamed this file to something more suitable for your purposes (my_neat_little_simple_foam_derivative.C for example).

And answering your second question: yes, several times. Use forum search and you will find similar questions asked and answered.
alexeym is offline   Reply With Quote

Old   September 7, 2015, 09:05
Default
  #5
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 10
Gerrit is on a distinguished road
Hi Alex,

you were somehow right! Although I checked my procedure several times, I missed to change the header of the files file...

Thanks anyway!

Edit:
If someone is interested in using simpleFoam with temperatures as a tutorial, this might help:

http://www.cloudpyme.eu/wp-content/u...on4-Slides.pdf

Last edited by Gerrit; September 8, 2015 at 03:25. Reason: Insert link
Gerrit is offline   Reply With Quote

Old   September 12, 2015, 10:24
Default
  #6
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 10
Gerrit is on a distinguished road
Hi,

for my project I need something to track particles, but solve as well as turbulent case. I found a guideline for a combination of simpleFoam and the Lagrangian solidParicle.
http://www.tfd.chalmers.se/~hani/kur...tonPersson.pdf

I am trying this now for some days, but I cannot build the solver and hope to find some help here.

After wmake I receive the following:
Code:
Making dependency list for source file injectorSolidParticle.C
could not open file cyclicAMIPolyPatch.H for source file injectorSolidParticle.C due to No such file or directory
could not open file meshTools.H for source file injectorSolidParticle.C due to No such file or directory
Making dependency list for source file injectorSolidParticleIO.C
could not open file cyclicAMIPolyPatch.H for source file injectorSolidParticleIO.C due to No such file or directory
could not open file meshTools.H for source file injectorSolidParticleIO.C due to No such file or directory
Making dependency list for source file injectorSolidParticleCloud.C
could not open file cyclicAMIPolyPatch.H for source file injectorSolidParticleCloud.C due to No such file or directory
could not open file meshTools.H for source file injectorSolidParticleCloud.C due to No such file or directory
Making dependency list for source file injectorSolidParticleFoam.C
could not open file cyclicAMILduInterface.H for source file injectorSolidParticleFoam.C due to No such file or directory
could not open file cyclicAMIPolyPatch.H for source file injectorSolidParticleFoam.C due to No such file or directory
could not open file fvIOoptionList.H for source file injectorSolidParticleFoam.C due to No such file or directory
could not open file meshTools.H for source file injectorSolidParticleFoam.C due to No such file or directory
could not open file createFvOptions.H for source file injectorSolidParticleFoam.C due to No such file or directory
SOURCE=injectorSolidParticle.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam240/src/turbulenceModels     -I/opt/openfoam240/src/turbulenceModels/incompressible/RAS/RASModel     -I/opt/openfoam240/src/transportModels     -I/opt/openfoam240/src/transportModels/incompressible/singlePhaseTransportModel     -I/opt/openfoam240/src/finiteVolume/lnInclude     -I/opt/openfoam240/src/lagrangian/basic/lnInclude -IlnInclude -I. -I/opt/openfoam240/src/OpenFOAM/lnInclude -I/opt/openfoam240/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/injectorSolidParticle.o
In file included from /opt/openfoam240/src/lagrangian/basic/lnInclude/Cloud.H:342:0,
                 from injectorSolidParticleCloud.H:40,
                 from injectorSolidParticle.C:26:
/opt/openfoam240/src/lagrangian/basic/lnInclude/Cloud.C:34:32: fatal error: cyclicAMIPolyPatch.H: No such file or directory
 #include "cyclicAMIPolyPatch.H"
                                ^
compilation terminated.
make: *** [Make/linux64GccDPOpt/injectorSolidParticle.o] Error 1
I am a little bit lost, as I do not know where to start debugging. Especially as the file cyclicAMIPolyPatch.H for example exists in src folder....
Furthermore it becomes really weird as none of the scripts in my folder call that file....

Can someone give a hint how/where to start?


Thank you!
Attached Files
File Type: zip injectorSolidParticleFoam.zip (13.9 KB, 7 views)
Gerrit is offline   Reply With Quote

Old   September 12, 2015, 16:25
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Since it is Håkan Nilsson's course I would propose that code is for foam-extend and could compile under OpenFOAM with certain corrections.

Since the error is caused by cyclicAMIPolyPatch.H, you can try to use

Code:
alexey at daphne in src$ pwd
/Users/alexey/OpenFOAM/OpenFOAM-2.4.x/src
alexey at daphne in src$ find . -name 'cyclicAMIPolyPatch.H'
./meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H
./meshTools/lnInclude/cyclicAMIPolyPatch.H
(2.4.x is just an example, in original OpenFOAM this file is in meshTools from version 2.1.x; 2.1.x is the earliest version I have on my laptop). So you have to add "-I$(LIB_SRC)/meshTools/lnInclude" to Make/options file to build be code.

Then if you try to build the code you have attached to the message, you need to add also "-I$(LIB_SRC)/fvOptions/lnInclude" and "-I$(LIB_SRC)/sampling/lnInclude" for Make/options file.

After these additions there is only problem at line 103 of injectorSolidParticleCloud.C, and it look like messed up comment. Overall code in the archive looks quite strange in the places with errors.
Gerrit likes this.

Last edited by alexeym; September 14, 2015 at 13:41.
alexeym is offline   Reply With Quote

Old   September 14, 2015, 08:29
Default
  #8
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 10
Gerrit is on a distinguished road
Hi Alex,

thank you so much for your answer! I did what you told me to!

The search for cyclicAMIPolyPatch.H gave the following. Looks like yours in my opinion.

Code:
gerrit@gerrit-HP-Pavilion-dv7-Notebook-PC:/opt/openfoam240/src$ find . -name 'cyclicAMIPolyPatch.H'
./meshTools/lnInclude/cyclicAMIPolyPatch.H
./meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H
Now I receive a new error:

Code:
linux64GccDPOpt/options:62: *** commands commence before first target.  Stop.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created in /home/gerrit/OpenFOAM/gerrit-2.4.0/applications/solvers/injectorSolidParticleFoam
What does the first one mean? I do understand the second line, but it is nonsense, because there is a folder called linux64GccDPOpt....

Thanks again!

Edit: Generally, how can I look in such cases for errors? Take the make/files file and check all listed files by hand?
Gerrit is offline   Reply With Quote

Old   September 14, 2015, 09:09
Default
  #9
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Post your Make/options. This time I can not guess what you have put there.
alexeym is offline   Reply With Quote

Old   September 14, 2015, 10:49
Default
  #10
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 10
Gerrit is on a distinguished road
Hi here you go, the make/options file:

Code:
EXE_INC = \
    -I$(LIB_SRC)/turbulenceModels \
    -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
    -I$(LIB_SRC)/finiteVolume/lnInclude  \
    -I$(LIB_SRC)/lagrangian/basic/lnInclude
    -I$(LIB_SRC)/meshTool/lnInclude
    -I$(LIB_SRC)/fvOptions/lnInclude
    -I$(LIB_SRC)/sampling/lnInclude

EXE_LIBS = \
    -lincompressibleRASModels \
    -lincompressibleTransportModels \
    -lfiniteVolume  \
    -llagrangian \
    -lincompressibleTurbulenceModel
Gerrit is offline   Reply With Quote

Old   September 14, 2015, 10:57
Default
  #11
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, as you can see there are \ symbols at the end of certain lines. They are there for purpose - https://www.gnu.org/software/make/ma...ing-Lines.html.

Your addition does not contain \ before new lines, so make (since wmake is just a wrapper around make) is quite unhappy about your addition. Make it:

Code:
EXE_INC = \
    -I$(LIB_SRC)/turbulenceModels \
    -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
    -I$(LIB_SRC)/finiteVolume/lnInclude  \
    -I$(LIB_SRC)/lagrangian/basic/lnInclude \
    -I$(LIB_SRC)/meshTool/lnInclude \
    -I$(LIB_SRC)/fvOptions/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude

EXE_LIBS = \
    -lincompressibleRASModels \
    -lincompressibleTransportModels \
    -lfiniteVolume  \
    -llagrangian \
    -lincompressibleTurbulenceModel
alexeym is offline   Reply With Quote

Old   September 14, 2015, 13:15
Default
  #12
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 10
Gerrit is on a distinguished road
Ok. I did not know that! Thanks for the input! Now my message after wclean and wmake is again:

Code:
Making dependency list for source file injectorSolidParticle.C
could not open file cyclicAMIPolyPatch.H for source file injectorSolidParticle.C due to No such file or directory
could not open file meshTools.H for source file injectorSolidParticle.C due to No such file or directory
Making dependency list for source file injectorSolidParticleIO.C
could not open file cyclicAMIPolyPatch.H for source file injectorSolidParticleIO.C due to No such file or directory
could not open file meshTools.H for source file injectorSolidParticleIO.C due to No such file or directory
Making dependency list for source file injectorSolidParticleCloud.C
could not open file cyclicAMIPolyPatch.H for source file injectorSolidParticleCloud.C due to No such file or directory
could not open file meshTools.H for source file injectorSolidParticleCloud.C due to No such file or directory
Making dependency list for source file injectorSolidParticleFoam.C
could not open file cyclicAMILduInterface.H for source file injectorSolidParticleFoam.C due to No such file or directory
could not open file cyclicAMIPolyPatch.H for source file injectorSolidParticleFoam.C due to No such file or directory
could not open file cellSet.H for source file injectorSolidParticleFoam.C due to No such file or directory
could not open file AMIPatchToPatchInterpolation.H for source file injectorSolidParticleFoam.C due to No such file or directory
could not open file meshTools.H for source file injectorSolidParticleFoam.C due to No such file or directory
SOURCE=injectorSolidParticle.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam240/src/turbulenceModels -I/opt/openfoam240/src/turbulenceModels/incompressible/RAS/RASModel -I/opt/openfoam240/src/transportModels -I/opt/openfoam240/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam240/src/finiteVolume/lnInclude -I/opt/openfoam240/src/lagrangian/basic/lnInclude -I/opt/openfoam240/src/meshTool/lnInclude -I/opt/openfoam240/src/fvOptions/lnInclude -I/opt/openfoam240/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam240/src/OpenFOAM/lnInclude -I/opt/openfoam240/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/injectorSolidParticle.o
In file included from /opt/openfoam240/src/lagrangian/basic/lnInclude/Cloud.H:342:0,
                 from injectorSolidParticleCloud.H:40,
                 from injectorSolidParticle.C:26:
/opt/openfoam240/src/lagrangian/basic/lnInclude/Cloud.C:34:32: fatal error: cyclicAMIPolyPatch.H: No such file or directory
 #include "cyclicAMIPolyPatch.H"
                                ^
compilation terminated.
As far as I understand it does not find the library cyclicAMIPolyPatch,H...
Can I somehow repair that? I guess it's only a link missing

The strange part is still that I do not use that file. When I search in my folder (injectorSolidParticleFoam) for it I do not get an answer, meaning it is not used in any of the files... (I searched with the command below)
Code:
find . -name 'cyclicAMIPolyPatch.H'
Gerrit is offline   Reply With Quote

Old   September 14, 2015, 13:41
Default
  #13
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
In message #11 I have just copies your options without verifying paths (though it seems, you've copied path from previous messages). Yet, correct path for include compiler flag is

Code:
-I$(LIB_SRC)/meshTools/lnInclude
alexeym is offline   Reply With Quote

Old   September 15, 2015, 02:27
Default
  #14
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 10
Gerrit is on a distinguished road
Ok, now we come closer

Code:
injectorSolidParticleCloud.C: In member function ‘void Foam::injectorSolidParticleCloud::move(const dimensionedVector&)’:
injectorSolidParticleCloud.C:101:78: error: no matching function for call to ‘Foam::injectorSolidParticle::injectorSolidParticle(Foam::injectorSolidParticleCloud&, Foam::vector&, Foam::label&, Foam::scalar&, Foam::vector&)’
    injectorSolidParticle*ptr= new injectorSolidParticle(*this,pos,cellI,d,vel);
                                                                              ^
injectorSolidParticleCloud.C:101:78: note: candidates are:
In file included from injectorSolidParticleCloud.H:41:0,
                 from injectorSolidParticleCloud.C:26:
injectorSolidParticle.H:131:9: note: Foam::injectorSolidParticle::injectorSolidParticle(const Foam::polyMesh&, Foam::Istream&, bool)
         injectorSolidParticle
         ^
injectorSolidParticle.H:131:9: note:   candidate expects 3 arguments, 5 provided
In file included from injectorSolidParticle.H:259:0,
                 from injectorSolidParticleCloud.H:41,
                 from injectorSolidParticleCloud.C:26:
injectorSolidParticleI.H:45:8: note: Foam::injectorSolidParticle::injectorSolidParticle(const Foam::polyMesh&, const vector&, Foam::label, Foam::label, Foam::label, Foam::scalar, const vector&)
 inline Foam::injectorSolidParticle::injectorSolidParticle
        ^
injectorSolidParticleI.H:45:8: note:   candidate expects 7 arguments, 5 provided
In file included from injectorSolidParticleCloud.H:41:0,
                 from injectorSolidParticleCloud.C:26:
injectorSolidParticle.H:58:7: note: Foam::injectorSolidParticle::injectorSolidParticle(const Foam::injectorSolidParticle&)
 class injectorSolidParticle
       ^
injectorSolidParticle.H:58:7: note:   candidate expects 1 argument, 5 provided
make: *** [Make/linux64GccDPOpt/injectorSolidParticleCloud.o] Error 1
that is what I now receive. Sounds like something is overdefined, or?
Gerrit is offline   Reply With Quote

Old   September 15, 2015, 03:09
Default
  #15
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

The error is self-explanatory: the number of parameters you have passed to constructor is wrong. Since the tutorial you are referencing was created for OpenFOAM 1.7.x it is not surprising that constructors could be changed.

Post your source code, maybe someone will find time to a) download it, b) try to compile it, c) find correct number of arguments to constructor, d) fix other errors, e) post solution here.

Also on the page, where you have found PDF file with report, there are tutorials about C++ and OpenFOAM. Read them before posting questions, since programming using forum is slow and counter-productive.
alexeym is offline   Reply With Quote

Old   September 15, 2015, 03:18
Default
  #16
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 10
Gerrit is on a distinguished road
I will do so! Thanks for your answer and your help so far!
Attached Files
File Type: zip injectorSolidParticleFoam.zip (13.9 KB, 17 views)
Gerrit is offline   Reply With Quote

Old   September 21, 2015, 05:54
Default
  #17
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 10
Gerrit is on a distinguished road
Hi,

I am still working on it and trying to understand the errors...
Whatever, I found a page, where they do the same process just instead of simpleFoam with interFoam.
As interFoam seems to be made for two phase flow, I am now a little bit confused, if I followed the correct idea...

Would interFoam combined with solidParticle a better choice? Or is it as well depending on the particle size?

Thanks!
Gerrit is offline   Reply With Quote

Old   February 28, 2018, 12:21
Default
  #18
Senior Member
 
Ali Shayegh
Join Date: Oct 2015
Posts: 130
Rep Power: 10
amuzeshi is on a distinguished road
I have prepared injectorSolidParticleFoam using this tutorial from chalmers. when I want " wmake " , this error happens; why?
Code:
injectorSolidParticleCloud.C: In member function ‘void Foam::injectorSolidParticleCloud::move(const dimensionedVector&)’:
injectorSolidParticleCloud.C:88:77: error: no matching function for call to ‘Foam::injectorSolidParticle::injectorSolidParticle(Foam::injectorSolidParticleCloud&, Foam::vector&, Foam::label&, Foam::scalar&, Foam::vector&)’
 injectorSolidParticle * ptr= new injectorSolidParticle(*this,pos,cellI,d,vel);
                                                                             ^
injectorSolidParticleCloud.C:88:77: note: candidates are:
In file included from injectorSolidParticleCloud.H:41:0,
                 from injectorSolidParticleCloud.C:26:
injectorSolidParticle.H:142:9: note: Foam::injectorSolidParticle::injectorSolidParticle(const Foam::polyMesh&, Foam::Istream&, bool)
         injectorSolidParticle
         ^
injectorSolidParticle.H:142:9: note:   candidate expects 3 arguments, 5 provided
In file included from injectorSolidParticle.H:272:0,
                 from injectorSolidParticleCloud.H:41,
                 from injectorSolidParticleCloud.C:26:
injectorSolidParticleI.H:45:8: note: Foam::injectorSolidParticle::injectorSolidParticle(const Foam::polyMesh&, const barycentric&, Foam::label, Foam::label, Foam::label, Foam::scalar, const vector&)
 inline Foam::injectorSolidParticle::injectorSolidParticle
        ^
injectorSolidParticleI.H:45:8: note:   candidate expects 7 arguments, 5 provided
In file included from injectorSolidParticleCloud.H:41:0,
                 from injectorSolidParticleCloud.C:26:
injectorSolidParticle.H:66:7: note: Foam::injectorSolidParticle::injectorSolidParticle(const Foam::injectorSolidParticle&)
 class injectorSolidParticle
       ^
injectorSolidParticle.H:66:7: note:   candidate expects 1 argument, 5 provided
injectorSolidParticle.H:66:7: note: Foam::injectorSolidParticle::injectorSolidParticle(Foam::injectorSolidParticle&&)
injectorSolidParticle.H:66:7: note:   candidate expects 1 argument, 5 provided
make: *** [Make/linux64GccDPInt32Opt/injectorSolidParticleCloud.o] Error 1
amuzeshi is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up a windtunnel in an OpenFOAM solver TommiPLaiho OpenFOAM Pre-Processing 6 November 17, 2014 06:56
simpleFoam: case only converges with most div schemes set to upwind buffi OpenFOAM Running, Solving & CFD 7 November 11, 2013 07:54
OpenCL linear solver for OpenFoam 1.7 (alpha) will come out very soon qinmaple OpenFOAM Announcements from Other Sources 4 August 10, 2012 11:00
Help with GNUPlot Renato. Main CFD Forum 6 June 6, 2007 19:51
How to set the two parameters of solver binterFoamb luckyluke OpenFOAM Running, Solving & CFD 7 June 3, 2005 06:33


All times are GMT -4. The time now is 07:39.