|
[Sponsors] |
How to compile a new solver in OpenFOAM-2.1.0? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 23, 2012, 23:17 |
How to compile a new solver in OpenFOAM-2.1.0?
|
#1 |
Senior Member
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18 |
Who can tell me how to compile a new solver in OpenFoam-2.1.0? I did them step by step following in http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam , however, I got error informations as follows:
MyinterFoam.C:65:41: fatal error: ../interFoam/correctPhi.H: No such file or directory compilation terminated. make: *** [Make/linuxGccDPOpt/MyinterFoam.o] Error 1 |
|
January 24, 2012, 06:50 |
|
#2 |
Senior Member
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 18 |
hello,
It work with 2.1.x too. Take a look at http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2010/anneKoesters/anneKoestersReport.pdf, there is a clear exemple here. The basic step are still: 1) copy the solver, i.e cp -r FOAM_SOLVERS/multiphase/interFoam in your use dir, i.e WM_PROJECT_USER_DIR/application/solver/multiphase/myInterFoam 2) change all interFoam by "myInterFoam" (or other name !) for: - interFoam.C - in Make/files 3) change in Make/files EXE = $(FOAM_APPBIN) by $FOAM_USER_APPBIN 4) if in files/option you have some "EXEC_INC = \ then change -I../blabla by -I$(LIB_SRC)/.. to link to the good lib. 5) wclean && wmake 6) if all compile well, the modify the solver .. regards, olivier |
|
January 24, 2012, 09:21 |
|
#3 |
Member
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 17 |
In your case the simplest solution would be, to copy the correctPhi.H file from the interFoam folder into your own solver folder
|
|
December 18, 2012, 19:17 |
|
#5 |
New Member
anonymous
Join Date: Jan 2012
Location: Canada
Posts: 24
Rep Power: 14 |
Hi guys
I have a similar problem in compiling the modified interFoam solver, I just added 2*alpha1*ghf*fvc::snGrad(rho) instead of ghf*fvc::snGrad(rho) to the UEq.H in the interFoam and after comilation it I got this error; /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable] make: *** [Make/linux64GccDPOpt/my_interFoam.o] Error 1 Can any body help me with it. Thanks |
|
December 19, 2012, 02:05 |
|
#6 | |
Senior Member
|
Quote:
|
||
December 29, 2012, 21:09 |
|
#7 |
New Member
anonymous
Join Date: Jan 2012
Location: Canada
Posts: 24
Rep Power: 14 |
Hi Mostafa
I think there is just a warning but when I use : ls $FOAM_USER_APPBIN I can not see my new solver in the list and I do not know why. Thanks |
|
December 30, 2012, 01:13 |
|
#8 |
Senior Member
|
I mean these info you added to your last post just contain a warning. the error is somewhere upper lines in your log!
|
|
December 31, 2012, 16:29 |
|
#9 |
New Member
anonymous
Join Date: Jan 2012
Location: Canada
Posts: 24
Rep Power: 14 |
Hi again
I compile the solver again and I think this should be the error: In file included from new-interFoam.C:89:0: UEqn.H: In function ‘int main(int, char**)’: UEqn.H:29:51: error: no match for ‘operator-’ in ‘Foam:perator*(const Foam::tmp<Foam::GeometricField<double, PatchField, GeoMesh> >&, const Foam::tmp<Foam::GeometricField<double, PatchField, GeoMesh> >&) [with PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh]((*(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >*)(& Foam::fvc::snGrad(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = double]()))) - Foam:perator*(const Foam::tmp<Foam::Field<double> >&, const Foam::UList<double>&)((* &(& Foam::fvc::snGrad(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = double]().Foam::tmp<T>:perator const T& [with T = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]())->Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::<anonymous>.Foam:imensionedF ield<double, Foam::surfaceMesh>::<anonymous>.Foam::Field<double >::<anonymous>.Foam::List<double>::<anonymous>)) ’ I appreciate any help |
|
December 31, 2012, 16:50 |
|
#10 |
New Member
anonymous
Join Date: Jan 2012
Location: Canada
Posts: 24
Rep Power: 14 |
Hi
As I realized, I have not done correctly multiplying the 2*alpha1 to the line 29 in the UEqn.H I do not know how to do that correctly, Can you help with that coding part? Thanks |
|
January 1, 2013, 00:01 |
|
#11 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
Hi dear mahyar
use Code:
2*fvc::interpolate(alpha1)
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
January 1, 2013, 00:48 |
|
#12 |
New Member
anonymous
Join Date: Jan 2012
Location: Canada
Posts: 24
Rep Power: 14 |
Hi Nima
Thanks for the help. This is the second time you are solving my problem and I appreciate it. |
|
November 28, 2013, 00:48 |
|
#13 |
Senior Member
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13 |
Hi all,
I have been compiling solvers in my user directory and have been successful. But I'm getting this error now. Code:
Making dependency list for source file buoyantBoussinesqSimpleFoamTemp.C could not open file fvCFD.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file volFieldsFwd.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file surfaceFieldsFwd.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file fvMatricesFwd.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file nearWallDist.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file volFields.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file surfaceFields.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file fvm.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file fvc.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file fvMatrices.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file bound.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file fvPatchField.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file fvMesh.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file simpleControl.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file readGravitationalAcceleration.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file createPhi.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file initContinuityErrs.H for source file buoyantBoussinesqSimpleFoamTemp.C could not open file continuityErrs.H for source file buoyantBoussinesqSimpleFoamTemp.C SOURCE=buoyantBoussinesqSimpleFoamTemp.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam222/src/finiteVolume/lnInclude -I/opt/openfoam222/src/sampling/lnInclude -I/opt/openfoam222/src/meshTools/lnInclude -I/opt/openfoam222/src/fvOptions/lnInclude -I/opt/openfoam222/src/turbulenceModels -I/opt/openfoam222/src/turbulenceModels/incompressible/RAS/lnInclude -I/opt/openfoam222/src/transportModels -I/opt/openfoam222/src/transportModels/incompressible/singlePhaseTransportModel -IlnInclude -I. -I/opt/openfoam222/src/OpenFOAM/lnInclude -I/opt/openfoam222/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/buoyantBoussinesqSimpleFoamTemp.o buoyantBoussinesqSimpleFoamTemp.C:48:19: fatal error: fvCFD.H: No such file or directory compilation terminated. make: *** [Make/linuxGccDPOpt/buoyantBoussinesqSimpleFoamTemp.o] Error 1 Thanks in advance.
__________________
Regards, Srivaths |
|
November 28, 2013, 04:18 |
|
#14 |
Senior Member
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 18 |
hello,
You don't have access to the openFoam file so check: - source the bashrc is not done ? - you loose the right permission to read/write in your solver directory and the read where openFoam is. regards, olivier |
|
November 28, 2013, 04:56 |
|
#15 |
Senior Member
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13 |
Hi Oliver,
- I have properly sourced the .bashrc file. - Where/how do i see if I have permission to access openfoam files?
__________________
Regards, Srivaths |
|
April 8, 2014, 00:28 |
|
#16 |
Member
|
Hi Sherlock,
for accesing any of the system files in ubuntu you must have some 'super-user' type of credentials. you can type Code:
sudo nautilus Code:
sudo su But,, please be careful because this are very powerful commands so, using it improperly, you may damage your OS. Hence, be specific about your commands and tasks and don't make any doubtful changes ins system files. Cheers, Adarsh Tiwari |
|
April 8, 2014, 03:06 |
|
#17 | |
Member
Christian Butcher
Join Date: Jul 2013
Location: Japan
Posts: 85
Rep Power: 13 |
Quote:
E.g. Code:
-rwxrwxr-x 1 christian christian 932 2月 11 20:59 Allwmake drwxrwxr-x 5 root root 4096 2月 11 20:59 applications drwxrwxr-x 3 christian christian 4096 2月 11 20:59 bin -rw-rw-r-- 1 christian christian 35647 2月 11 20:59 COPYING drwxrwxr-x 6 christian christian 4096 2月 11 20:59 doc drwxrwxr-x 6 christian christian 4096 4月 4 10:09 etc -rw-r--r-- 1 christian christian 316210 4月 2 09:34 log.Allwmake2 drwxr-xr-x 3 christian christian 4096 4月 1 17:16 platforms -rw-rw-r-- 1 christian christian 7611 2月 11 20:59 README.html -rw-rw-r-- 1 christian christian 1587 2月 11 20:59 README.org drwxrwxr-x 37 root root 4096 2月 11 20:59 src drwxrwxr-x 16 root root 4096 2月 11 20:59 tutorials drwxrwxr-x 6 root root 4096 4月 1 17:16 wmake |
||
July 30, 2014, 07:34 |
|
#18 |
New Member
|
please tell me how can i compile new solver in existing OPENFOAM?
|
|
July 30, 2014, 09:24 |
|
#19 |
New Member
Quentin Coispeau
Join Date: Nov 2013
Posts: 17
Rep Power: 13 |
Hi,
1) Copy an existing solver which is similar to what you want to do in a personal repertory. 2) change name of your solver. for example, remplace all "LTSInterFoam" by "my_LSInterFoam" in files name and files content. 3) in Make/file change also the solver name by the new name and EXE = $(FOAM_APPBIN)/my_LTSInterFoam by EXE = $(FOAM_USER_APPBIN)/my_LTSInterFoam 4) wmake it from the shell in the appropriate directory 5) try he new solver 6) if it's ok, you can make your modifications ; you have to wmake it again before using. openFoam documentation after googling "compile solver openFOAM" |
|
September 27, 2014, 16:12 |
Problem in compiling
|
#20 |
New Member
krishh
Join Date: Apr 2012
Posts: 16
Rep Power: 14 |
Hi,
I am trying to simulate a drop case in OF 2.3.0 using compressibleMultiphaseInterFoam. I tried it 2 times, yet the gravity acts in +Y axis when I set it to -Y axis. To trick it, I changed gravity direction to +Y axis, now the gravity acts in +Y axis only. The same case was run in other models interFoam, multiphaseInterFoam in older versions of OF. Now I tried to compile the compressibleMultiphaseInterFoam solver from OF 2.3.0 in OF 2.2.2. I get an error which I dont understand. Error is in 'typescript' file in the .rar file attached. I has also added the solver in .rar file. Please some one help me. I need it. Thanks a ton in advance. .rar file can be downloaded here. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Viscoelastic Fluid Flows using OpenFOAM The solver viscoelasticFluidFoam | jovani | OpenFOAM Running, Solving & CFD | 475 | January 13, 2023 09:21 |
Acoustic Solver with openfoam | acoustica | OpenFOAM Programming & Development | 110 | February 24, 2021 19:50 |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 | wyldckat | OpenFOAM Announcements from Other Sources | 3 | September 8, 2010 07:25 |
AMG solver in Openfoam | gonski | Main CFD Forum | 0 | November 25, 2007 06:20 |