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

adding energy equation to interFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes
  • 1 Post By Elham
  • 1 Post By wyldckat
  • 2 Post By kebsiali

Reply
 
LinkBack Thread Tools Display Modes
Old   November 26, 2015, 02:29
Default adding energy equation to interFoam
  #1
Senior Member
 
Elham
Join Date: Oct 2009
Posts: 101
Rep Power: 9
Elham is on a distinguished road
Hi,

I am trying to add energy equation to interFoam. So I made a new library called myincompressibleTwoPhaseMixture and a solver called interTempFoam as suggested by http://www.wolfdynamics.com/images/c...erTempFoam.pdf.
I could successfully compile the library in openFoam 2.3.0 but I cannot compile the solver. I got the following error:

/usr/bin/ld: cannot find -lmyincompressibleTwoPhaseMixture
collect2: error: ld returned 1 exit status
make: *** [/home/elham/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/bin/interTempFoam] Error 1

I have attached my library and solver. I will be really appreciate if anyone can give me clue.
Attached Files
File Type: gz library.tar.gz (6.3 KB, 17 views)
File Type: gz interTempFoam.tar.gz (10.5 KB, 16 views)
Mojtaba.a likes this.
Elham is offline   Reply With Quote

Old   November 28, 2015, 10:15
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,020
Blog Entries: 39
Rep Power: 109
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Quick answer:
  1. The library package in "Make/files" has defined the name "libmyincompressibleTransportModels".
  2. The solver is looking for the name "libmyincompressibleTwoPhaseMixture".
  3. Can't see the difference? Try seeing it like this:
    Code:
    libmyincompressibleTransportModels
    libmyincompressibleTwoPhaseMixture
Elham likes this.
wyldckat is offline   Reply With Quote

Old   November 28, 2015, 12:23
Default
  #3
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 7
kebsiali is on a distinguished road
http://www.cfd-online.com/Forums/ope...interfoam.html

you can check the 6th and 7th discussion in this link where i explained what to add to the make file of your solver and modified library
Elham and Mojtaba.a like this.

Last edited by kebsiali; November 28, 2015 at 13:24. Reason: adding info
kebsiali is offline   Reply With Quote

Old   December 7, 2015, 09:30
Default
  #4
Pay
New Member
 
Perry Uhlig
Join Date: Oct 2015
Location: Germany
Posts: 13
Rep Power: 3
Pay is on a distinguished road
Hello,

you can have a look at my thread. I got interTempFoam compiled using OF 2.4.0.

Unfortunately the new solver creates temperature fields that contain obvious mistakes.

http://www.cfd-online.com/Forums/ope...m-2-4-0-a.html
Pay is offline   Reply With Quote

Old   March 4, 2016, 12:44
Question error while compiling libaray
  #5
New Member
 
Rimsha
Join Date: Jan 2016
Posts: 25
Rep Power: 3
block is on a distinguished road
Hi all,

nice to see so much discussion and support,

I am trying to compile the lib after altering it using this guide to implement temperature equation in interFoam

http://www.wolfdynamics.com/images/c...erTempFoam.pdf

however I am unable to wmake my lib as it keeps giving me this error.

This is what happens when i command wmake

Code:
wmake libso >logs
Make/options:7:12: warning: backslash-newline at end of file [enabled by default]
 LIB_LIBS = \
 ^
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file singlePhaseTransportModel/singlePhaseTransportModel.C
Making dependency list for source file transportModel/transportModel.C
Making dependency list for source file viscosityModels/HerschelBulkley/HerschelBulkley.C
Making dependency list for source file viscosityModels/BirdCarreau/BirdCarreau.C
Making dependency list for source file viscosityModels/CrossPowerLaw/CrossPowerLaw.C
Making dependency list for source file viscosityModels/powerLaw/powerLaw.C
Making dependency list for source file viscosityModels/Newtonian/Newtonian.C
Making dependency list for source file viscosityModels/viscosityModel/viscosityModelNew.C
Making dependency list for source file viscosityModels/viscosityModel/viscosityModel.C
make: *** No rule to make target `Make/linux64GccDPInt32Opt/myIncompressibleTwoPhaseMixture/myIncompressibleTwoPhaseMixture.C.dep', needed by `Make/linux64GccDPInt32Opt/myIncompressibleTwoPhaseMixture/myIncompressibleTwoPhaseMixture.o'. Stop.
This is how my make>file looks

Code:
viscosityModels/viscosityModel/viscosityModel.C
viscosityModels/viscosityModel/viscosityModelNew.C
viscosityModels/Newtonian/Newtonian.C
viscosityModels/powerLaw/powerLaw.C
viscosityModels/CrossPowerLaw/CrossPowerLaw.C
viscosityModels/BirdCarreau/BirdCarreau.C
viscosityModels/HerschelBulkley/HerschelBulkley.C

transportModel/transportModel.C
singlePhaseTransportModel/singlePhaseTransportModel.C

myIncompressibleTwoPhaseMixture/myIncompressibleTwoPhaseMixture.C

LIB = $(FOAM_USER_LIBBIN)/libmyIncompressibleTransportModels
here is my make>option looks
Code:
EXE_INC = \
    -I.. \
    -I../twoPhaseMixture/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

LIB_LIBS = \
    -ltwoPhaseMixture \
    -lfiniteVolume \
I dont know what the link error is, sorry if this is too basic because i am new to OpenFOAM.

help will be much appreciated

Thanks

Rimsha

Last edited by wyldckat; March 6, 2016 at 11:34. Reason: Added [CODE][/CODE] markers
block is offline   Reply With Quote

Old   March 6, 2016, 17:17
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,020
Blog Entries: 39
Rep Power: 109
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Quick request @Rimsha: Please provide the source code package that you're using. I ask this because it will be a lot quicker to help you if you do this.
In addition, please keep in mind that you seem to be using OpenFOAM 3.0, which has some big differences from OpenFOAM 2.3.0, including in its build process.
__________________
wyldckat is offline   Reply With Quote

Old   March 6, 2016, 17:25
Default
  #7
New Member
 
Rimsha
Join Date: Jan 2016
Posts: 25
Rep Power: 3
block is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick request @Rimsha: Please provide the source code package that you're using. I ask this because it will be a lot quicker to help you if you do this.
In addition, please keep in mind that you seem to be using OpenFOAM 3.0, which has some big differences from OpenFOAM 2.3.0, including in its build process.

Hiya, thank you very much for your reply, it is highly appreciated.

May i know where i can find this source code, do you mean the lib code that i am trying to wmake?

I am sorry if this sounds stupid but i am very new to this software.
block is offline   Reply With Quote

Old   March 6, 2016, 17:32
Default
  #8
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,020
Blog Entries: 39
Rep Power: 109
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Quote:
Originally Posted by block View Post
do you mean the lib code that i am trying to wmake?
Yes

Quick example, run the following command from within your source code folder:
Code:
wclean all
cd ..
Then package the folder by running something like this:
Code:
tar -czf the_package_name.tar.gz  the_library_folder
rename the tilted names and then attach the "the_package_name.tar.gz" file in your next post.
wyldckat is offline   Reply With Quote

Old   March 6, 2016, 17:35
Default
  #9
New Member
 
Rimsha
Join Date: Jan 2016
Posts: 25
Rep Power: 3
block is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Yes

Quick example, run the following command from within your source code folder:
Code:
wclean all
cd ..
Then package the folder by running something like this:
Code:
tar -czf the_package_name.tar.gz  the_library_folder
rename the tilted names and then attach the "the_package_name.tar.gz" file in your next post.
thank Bruno Santos,

unfortunately i am not in the office at the moment however first thing tomorrow morning i will do that and attach the file.
block is offline   Reply With Quote

Old   March 7, 2016, 17:20
Question
  #10
New Member
 
Rimsha
Join Date: Jan 2016
Posts: 25
Rep Power: 3
block is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Yes

Quick example, run the following command from within your source code folder:
Code:
wclean all
cd ..
Then package the folder by running something like this:
Code:
tar -czf the_package_name.tar.gz  the_library_folder
rename the tilted names and then attach the "the_package_name.tar.gz" file in your next post.
Library trying to make >>incompressible.tar.gz

Hiya, I have attached the lib above.

Basically I am trying to add temperature heat capacity to interFoam however there are two approaches one could take

Method 1:
before editing solver and adding the equation, I have to alter "incompressibletwophasemixture" file however instead of altering the file, i got an additional file called twoPhaseThermalMixture.C and H where new variable related to heat capacity (cp) Prandl number and diffusion coefficient (kappa in the file). This file is then linked to "incompressibletwophasemixture" file using the file in make folder and also in "incompressibletwophasemixture.C" it is included in the beginning.

However with this approah I am getting error where nothing in C file of twoPhaseThermalMixture.C is being recognized when i wmake libso.

i attach the log file log.txt


Method 2

In second method I have followed this tutorial

http://www.wolfdynamics.com/images/c...erTempFoam.pdf

In this approach you can edit "incompressibletwophasemixture.C" and "incompressibletwophasemixture.H" to include all the new variables that are included in twoPhaseThermalMixture.C and twoPhaseThermalMixture.H in method 1. once that is done you can just make this library again however this also gives ridiculous errors therefore i am not sure what to do.

Hope I was able to explain my problem well, I am extremely grateful for your effort to help me.

My OpenFoam is 3.0.1 i am not sure if that is the case why this library alterations are not working.

here are the files for 2nd approach and the log file is included
incompressible_Ap2.tar.gz



Rimsha
block is offline   Reply With Quote

Old   March 28, 2016, 11:11
Default
  #11
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,020
Blog Entries: 39
Rep Power: 109
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Hi Rimsha,

Sorry, but only today did I finally managed to take a look into your questions. Nonetheless, I've checked other posts you've made since then and it seems that you've already solved your problem?
I'm referring to the posts you made in the following threads:
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   January 29, 2017, 15:14
Default
  #12
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 291
Rep Power: 9
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by kebsiali View Post
http://www.cfd-online.com/Forums/ope...interfoam.html

you can check the 6th and 7th discussion in this link where i explained what to add to the make file of your solver and modified library
Just to make it clear of future readers, the thread suggested by Ali solved my problem.
Just try adding this code into your options file:
Code:
-L$(FOAM_USER_LIBBIN) \
Adios!
__________________
Learn OpenFOAM in Persian for free, And ask your questions here.
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Energy Equation for porousSimpleFoam yesaswi92 OpenFOAM Programming & Development 4 July 29, 2015 06:04
Definition of energy equation using UDF aestas Fluent UDF and Scheme Programming 15 April 28, 2015 03:33
Source Term due to evaporation in energy transport equation styleworker OpenFOAM Programming & Development 2 September 3, 2014 21:24
Questions about the energy equation aestas Fluent UDF and Scheme Programming 5 April 6, 2014 11:28
SIMPLE and energy equation convergence Fabio Main CFD Forum 0 June 1, 2007 06:06


All times are GMT -4. The time now is 17:55.