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

Diverging result for Temperature field in interFoam

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

Like Tree45Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 5, 2010, 12:59
Default
  #41
Member
 
Join Date: Nov 2009
Posts: 48
Rep Power: 16
farhagim is on a distinguished road
Hello Ovie,

Thanks for sharing your information. I tried to compile your interTempFoam code and incomprissileTwoPhaseThermalMixture file, I got this error during compiling the main code. Would you please tell me what is the problem?

Making dependency list for source file interTempFoam.C
SOURCE=interTempFoam.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I./transportModels -I./transportModels/incompressible/lnInclude -I./transportModels/interfaceProperties/lnInclude -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/incompressible/turbulenceModel -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/interTempFoam.o
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:14: warning: unused variable ‘nOuterCorr’
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:3: warning: unused variable ‘nCorr’
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:8: warning: unused variable ‘momentumPredictor’
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:14: warning: unused variable ‘nOuterCorr’
g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I./transportModels -I./transportModels/incompressible/lnInclude -I./transportModels/interfaceProperties/lnInclude -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/incompressible/turbulenceModel -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC Make/linuxGccDPOpt/interTempFoam.o -L/home/mehran/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt \
-L/home/mehran/OpenFOAM/mehran-1.6/lib/linuxGccDPOpt -linterfaceProperties -lincompressibleTransportModels -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -lOpenFOAM -liberty -ldl -lm -o /home/mehran/OpenFOAM/mehran-1.6/applications/bin/linuxGccDPOpt/interTempFoam
Make/linuxGccDPOpt/interTempFoam.o: In function `main':
interTempFoam.C.text+0x4930): undefined reference to `Foam::twoPhaseMixture::kappaf() const'
collect2: ld returned 1 exit status
make: *** [/home/mehran/OpenFOAM/mehran-1.6/applications/bin/linuxGccDPOpt/interTempFoam] Error 1

Thanks,

MEhran



QUOTE=ovie;264901]Hi Metro,

Like I said in an earlier reply, if the instability you speak of is at the interfacial region then its almost a consequence of the sharp jump in material properties at the interface. In other words, if the difference in specific heat (cp) between the two fluids is significant then grid resolution might not solve the problem. Besides, since cp is such a huge value compared to the other fluid properties, it only serves to blow up the convective term in the discretized governing equation relative to the other terms. So the instability is persistent.

However, you may modify the equations if certain conditions apply: if the specific heat of the fluids is not dependent on temperature or still weakly dependent or if the temperature differences within the flow (eg between the heated or cooled wall and the incoming fluid) is not "large" (note that you would have to evaluate the fluid properties at the mean temperature), you can move cp from the convective term to the diffusive term so that the governing equation to solve is

d(rho*T)/dt + div(rho*V*T) = div((kappa/cp)*grad T) + source terms/cp

This is a more stable problem. For your TEqn.H, you can do:

volScalarField kappa = twoPhaseProperties.kappa();
volScalarField Cp = alpha1*cp1 + (scalar(1) - alpha1)*cp2;

fvScalarMatrix TEqn
(
fvm::ddt(rho, T)
+ fvm::div(rhoPhi, T)
- fvm::laplacian((kappa/Cp), T)
);

TEqn.solve();

rho and rhoPhi already come from alphaEqnSubCycle.H and alphaEqn.H respectively. In this case, you would no longer require rhoCp and rhoPhiCp.

Hope this helps.[/QUOTE]
farhagim is offline   Reply With Quote

Old   October 5, 2010, 14:21
Default
  #42
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
Hi Faraghim,

Please check in your incompressibleTwoPhaseThemalMixture file if the function `Foam::twoPhaseMixture::kappaf() const' actually exits. And then check in your temperature equation in interTempFoam to see how you calculate the mixture thermal conductivity. Looks like there is some mix up somewhere in between.

Thanks
mizzou likes this.
ovie is offline   Reply With Quote

Old   October 5, 2010, 22:23
Default
  #43
Member
 
Join Date: Nov 2009
Posts: 48
Rep Power: 16
farhagim is on a distinguished road
Hello,

I checked the incompressibleTwoPhaseThemalMixture file. the Foam::twoPhaseThermalMixture::kappaf() const exists there. and I also check the TEqn.H:

surfaceScalarField kappaf = twoPhaseProperties.kappaf();


fvScalarMatrix TEqn
(
fvm::ddt(rhoCp, T)
+ fvm::div(rhoPhiCp, T)
- fvm::laplacian(kappaf, T)
);

TEqn.solve();

everything looks fine, but I dont know what is the problem.
I am just using your uploaded file in this thread. would mind take look at the file.??

Thanks,

Mehran

Quote:
Originally Posted by ovie View Post
Hi Faraghim,

Please check in your incompressibleTwoPhaseThemalMixture file if the function `Foam::twoPhaseMixture::kappaf() const' actually exits. And then check in your temperature equation in interTempFoam to see how you calculate the mixture thermal conductivity. Looks like there is some mix up somewhere in between.

Thanks
farhagim is offline   Reply With Quote

Old   October 5, 2010, 22:51
Default
  #44
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
Which of the files did you compile first? You have to compile the incompressibleTwoPhaseThermalMixture file first before the interTempFoam solver. I have looked through and really cant find any differences between what I have here and what is on the thread.

Please let me know if you still have any problems.

Thanks.
ovie is offline   Reply With Quote

Old   October 6, 2010, 12:54
Default
  #45
Member
 
Join Date: Nov 2009
Posts: 48
Rep Power: 16
farhagim is on a distinguished road
Hello,

Thanks for your answer. I compiled the incompressibleTwoPhaseThermalMixture file without a problem , then I compile interTempFoam solver. and I got this error:
Making dependency list for source file interTempFoam.C
SOURCE=interTempFoam.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I./transportModels -I./transportModels/incompressible/lnInclude -I./transportModels/interfaceProperties/lnInclude -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/incompressible/turbulenceModel -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/interTempFoam.o
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:14: warning: unused variable ‘nOuterCorr’
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:3: warning: unused variable ‘nCorr’
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:8: warning: unused variable ‘momentumPredictor’
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’
/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:14: warning: unused variable ‘nOuterCorr’
g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I./transportModels -I./transportModels/incompressible/lnInclude -I./transportModels/interfaceProperties/lnInclude -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/incompressible/turbulenceModel -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/mehran/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC Make/linuxGccDPOpt/interTempFoam.o -L/home/mehran/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt \
-L/home/mehran/OpenFOAM/mehran-1.6/lib/linuxGccDPOpt -linterfaceProperties -lincompressibleTransportModels -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -lOpenFOAM -liberty -ldl -lm -o /home/mehran/OpenFOAM/mehran-1.6/applications/bin/linuxGccDPOpt/interTempFoam
Make/linuxGccDPOpt/interTempFoam.o: In function `main':
interTempFoam.C.text+0xf68): undefined reference to `Foam::twoPhaseThermalMixture::twoPhaseThermalMixt ure(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::word const&)'
interTempFoam.C.text+0x2d16): undefined reference to `Foam::twoPhaseThermalMixture::calcKappa()'
interTempFoam.C.text+0x4940): undefined reference to `Foam::twoPhaseThermalMixture::kappaf() const'
Make/linuxGccDPOpt/interTempFoam.o: In function `Foam::twoPhaseThermalMixture::~twoPhaseThermalMix ture()':
interTempFoam.C.text._ZN4Foam22twoPhaseThermalMi xtureD1Ev[Foam::twoPhaseThermalMixture::~twoPhaseThermalMixt ure()]+0x19): undefined reference to `vtable for Foam::twoPhaseThermalMixture'
collect2: ld returned 1 exit status
make: *** [/home/mehran/OpenFOAM/mehran-1.6/applications/bin/linuxGccDPOpt/interTempFoam] Error 1

any idea what might be the problem?
I can send you the whole file, if you give me your email address.

Thanks,

Mehran

Quote:
Originally Posted by ovie View Post
Which of the files did you compile first? You have to compile the incompressibleTwoPhaseThermalMixture file first before the interTempFoam solver. I have looked through and really cant find any differences between what I have here and what is on the thread.

Please let me know if you still have any problems

Thanks.
farhagim is offline   Reply With Quote

Old   October 6, 2010, 13:16
Default
  #46
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
hi farhagim,

I can see that the constructor and a number of the functions in the incompressibleTwoPhaseThermalMixturec class are reported in the error log. Perharps the new class is not included in the new solver. In any case email me at oviefowe@yahoo.co.uk. Hopefully we can fix this.

Thanks
Kummi likes this.
ovie is offline   Reply With Quote

Old   October 6, 2010, 13:23
Default
  #47
Member
 
Join Date: Nov 2009
Posts: 48
Rep Power: 16
farhagim is on a distinguished road
I can not send anything to this email address. it was rejected by the recipient domain. Do you have another Email address?

Quote:
Originally Posted by ovie View Post
hi farhagim,

I can see that the constructor and a number of the functions in the incompressibleTwoPhaseThermalMixturec class are reported in the error log. Perharps the new class is not included in the new solver. In any case email me at oviefowe@yahoo.co.uk. Hopefully we can fix this.

Thanks
farhagim is offline   Reply With Quote

Old   October 6, 2010, 13:29
Default
  #48
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
Please send me your email.
ovie is offline   Reply With Quote

Old   October 6, 2010, 13:34
Default
  #49
Member
 
Join Date: Nov 2009
Posts: 48
Rep Power: 16
farhagim is on a distinguished road
this is my email address:
farhangi.mehran@gmail.com
Quote:
Originally Posted by ovie View Post
Please send me your email.
farhagim is offline   Reply With Quote

Old   October 23, 2010, 05:16
Default
  #50
New Member
 
NieYongguang
Join Date: Sep 2010
Posts: 27
Rep Power: 15
nygbook is on a distinguished road
Quote:
Originally Posted by farhagim View Post
this is my email address:
farhangi.mehran@gmail.com
I encountered the same problem, when i compiled the code. if you have solve the problem, please tell me. My email is nygbook@gmail.com
nygbook is offline   Reply With Quote

Old   October 23, 2010, 11:47
Default
  #51
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
Quote:
Originally Posted by nygbook View Post
I encountered the same problem, when i compiled the code. if you have solve the problem, please tell me. My email is nygbook@gmail.com
Could you please be a bit more specific with the problem?
ovie is offline   Reply With Quote

Old   October 25, 2010, 06:00
Default
  #52
New Member
 
NieYongguang
Join Date: Sep 2010
Posts: 27
Rep Power: 15
nygbook is on a distinguished road
Hello! ovie. I'm a new foamer. I download the code you shared and put all of them into same folder. Consequently, when I wmake them, the same error information mentioned by farhagim appeared.

Quote:
Make/linuxGccDPOpt/interTempFoam.o: In function `main':
interTempFoam.C.text+0xf68): undefined reference to `Foam::twoPhaseThermalMixture::twoPhaseThermalMixt ure(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::word const&)'
interTempFoam.C:(.text+0x2d16): undefined reference to `Foam::twoPhaseThermalMixture::calcKappa()'
interTempFoam.C:(.text+0x4940): undefined reference to `Foam::twoPhaseThermalMixture::kappaf() const'
Make/linuxGccDPOpt/interTempFoam.o: In function `Foam::twoPhaseThermalMixture::~twoPhaseThermalMix ture()':
interTempFoam.C.text._ZN4Foam22twoPhaseThermalMi xtureD1Ev[Foam::twoPhaseThermalMixture::~twoPhaseThermalMixt ure()]+0x19): undefined reference to `vtable for Foam::twoPhaseThermalMixture'
collect2: ld 返回 1
make: *** [/home/nyg/OpenFOAM/nyg-1.6/applications/bin/linuxGccDPOpt/interTempFoam] 错误 1


You have written above that You have to compile the incompressibleTwoPhaseThermalMixture file first before the interTempFoam solver. I doesn't understand because of lack of program experience in linux. How should I compile the incompressibleTwoPhaseThermalMixture file first.
nygbook is offline   Reply With Quote

Old   October 25, 2010, 11:37
Default
  #53
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
Quote:
Originally Posted by nygbook View Post
Hello! ovie
You have written above that You have to compile the incompressibleTwoPhaseThermalMixture file first before the interTempFoam solver. I doesn't understand because of lack of program experience in linux. How should I compile the incompressibleTwoPhaseThermalMixture file first.
Pls send ur email and I would forward you detailed instros on how to get this done. But going forward, you would find all the instructions you need in the OpenFOAM manual or programming guide.

good luck!
ovie is offline   Reply With Quote

Old   October 25, 2010, 11:44
Default
  #54
New Member
 
NieYongguang
Join Date: Sep 2010
Posts: 27
Rep Power: 15
nygbook is on a distinguished road
Quote:
Originally Posted by ovie View Post
Pls send ur email and I would forward you detailed instros on how to get this done. But going forward, you would find all the instructions you need in the OpenFOAM manual or programming guide.

good luck!
Thank you every much! ovie. My Email address is nygbook@gmail.com
nygbook is offline   Reply With Quote

Old   October 25, 2010, 11:51
Default
  #55
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
Quote:
Originally Posted by nygbook View Post
Thank you every much! ovie. My Email address is nygbook@gmail.com
Please check your inbox!
Good luck..
ovie is offline   Reply With Quote

Old   October 30, 2010, 10:44
Default
  #56
New Member
 
NieYongguang
Join Date: Sep 2010
Posts: 27
Rep Power: 15
nygbook is on a distinguished road
Quote:
Originally Posted by ovie View Post
Please check your inbox!
Good luck..
Thank you! ovie, I have received the email. According to the instruction in your email, I have successfully compiled the code.
nygbook is offline   Reply With Quote

Old   October 30, 2010, 11:55
Default
  #57
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 16
ovie is on a distinguished road
Quote:
Originally Posted by nygbook View Post
Thank you! ovie, I have received the email. According to the instruction in your email, I have successfully compiled the code.
No worries and good luck!
moosgeist likes this.
ovie is offline   Reply With Quote

Old   November 9, 2010, 11:15
Default
  #58
ala
New Member
 
Alicja M
Join Date: Mar 2009
Location: Erlangen, DE
Posts: 26
Rep Power: 17
ala is on a distinguished road
Hello,

i tried out a similar implementation and also Ovie's implementation of
'temperature equation' with interFoam. I have simulated a test case,
cavity with two phases and also with one phase (modified dam break). With one phase it seems
to work fine, with both phases it crashes. I tried it also with harmonic
interpolation and it didn't helped. Any idea? Similar problems?

Greetings,
Alicja
Attached Images
File Type: jpg T.0003.jpg (13.5 KB, 172 views)
File Type: jpg T.0010.jpg (14.5 KB, 162 views)
File Type: jpg T.0027.jpg (19.0 KB, 217 views)
ala is offline   Reply With Quote

Old   November 30, 2010, 14:51
Default interTempFoam for 2 components
  #59
New Member
 
Join Date: Sep 2010
Posts: 1
Rep Power: 0
Sascha612 is on a distinguished road
Hey,

I have the same problems as Alicja.
When there is a big difference in the phase-properties of the 2 fluids my simulation crashs.
I also tried it with the dam-break tutorial.

Does anyone has a solution for this or rather has a solver which works for this problem?
What do I have to change?


Thanks,

Sascha
Sascha612 is offline   Reply With Quote

Old   December 6, 2010, 11:50
Default
  #60
ala
New Member
 
Alicja M
Join Date: Mar 2009
Location: Erlangen, DE
Posts: 26
Rep Power: 17
ala is on a distinguished road
Hey,

maybe it is a bug? I have tried a 1D problem out (heat diffussion). I have calculated it with OpenFoam and Matlab (my similar code). i have got similar matrices, but solutions are different. I have also a big difference in the phase-properties of the 2 fluid. I have builded in an oscillation of the interface between both phases.

I 've plottetd T vs x position in mesh
Attached Files
File Type: pdf 1dcode_solution.pdf (8.9 KB, 174 views)
File Type: pdf of_solution.pdf (3.4 KB, 150 views)
ala is offline   Reply With Quote

Reply

Tags
interfoam energy, temperature field

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a concentration field around a bubble in InterFoam azman OpenFOAM Running, Solving & CFD 3 June 7, 2022 05:21
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Adding temperature field to InterFoam yapalparvi OpenFOAM Running, Solving & CFD 8 October 14, 2009 21:18
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
Problems calculating field gh with interFoam cricke OpenFOAM Running, Solving & CFD 0 December 10, 2007 08:17


All times are GMT -4. The time now is 05:16.