How to compile a new solver in OpenFOAM-2.1.0?
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 |
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 |
In your case the simplest solution would be, to copy the correctPhi.H file from the interFoam folder into your own solver folder
|
|
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 |
Quote:
|
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 |
I mean these info you added to your last post just contain a warning. the error is somewhere upper lines in your log!
|
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::operator*(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::operator*(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>::operator const T& [with T = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]())->Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::<anonymous>.Foam::DimensionedF ield<double, Foam::surfaceMesh>::<anonymous>.Foam::Field<double >::<anonymous>.Foam::List<double>::<anonymous>)) ’ I appreciate any help |
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 |
Hi dear mahyar
use Code:
2*fvc::interpolate(alpha1) |
Hi Nima
Thanks for the help. This is the second time you are solving my problem and I appreciate it. |
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 Thanks in advance. |
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 |
Hi Oliver,
- I have properly sourced the .bashrc file. - Where/how do i see if I have permission to access openfoam files? |
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.:p:D Hence, be specific about your commands and tasks and don't make any doubtful changes ins system files.;);) Cheers,:D:D Adarsh Tiwari |
Quote:
E.g. Code:
-rwxrwxr-x 1 christian christian 932 2月 11 20:59 Allwmake |
please tell me how can i compile new solver in existing OPENFOAM?
|
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" |
Problem in compiling
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. |
All times are GMT -4. The time now is 18:19. |