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 Community New Posts Updated Threads Search

Like Tree45Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2013, 01:12
Default
  #81
New Member
 
thejaraju
Join Date: Dec 2010
Posts: 8
Rep Power: 16
thejaraju is on a distinguished road
Yes i will surely try and reply you................

I hope it works well

Please also find the visoelasticInterfoam solvers which i am attaching with the reply

Thank you very much for the reply

Regards

Thejaraju.R
thejaraju is offline   Reply With Quote

Old   December 23, 2013, 01:19
Default
  #82
New Member
 
thejaraju
Join Date: Dec 2010
Posts: 8
Rep Power: 16
thejaraju is on a distinguished road
Quote:
Originally Posted by Bernhard View Post
You are working in OpenFOAM 2.2.x. The solver you are trying to compare has probably been developed for some older of version of OpenFOAM. Please check what has been changed between this previous version and the one you are using. Incorporate these changes in the solver you are trying to compile. Then you're done

Thankyou very much reply .........

I will definitely check this and come back to you
thejaraju is offline   Reply With Quote

Old   April 7, 2014, 07:09
Default
  #83
New Member
 
Thilo Franke
Join Date: Mar 2014
Location: Bunswick
Posts: 4
Rep Power: 12
denhelden is on a distinguished road
Hi,

few questions about the InterTempFoam-Solver:

- For which OpenFoam Version the Solver is written?
- Did anybody write a version for 2.2?
- Does anybody have a test case for the solver he likes to share?

and for my understanding:

- why does the solver uses PISO instead of PIMPLE like the actual InterFoam?

Thank you for answering
Regards,
Thilo
denhelden is offline   Reply With Quote

Old   April 8, 2014, 18:21
Default
  #84
Member
 
sajad
Join Date: Aug 2013
Posts: 71
Rep Power: 13
seju is on a distinguished road
Quote:
Originally Posted by ovie View Post
Please check your inbox!
Good luck..
hi ovie
I have same problem can you send me too.
my Email is :sajad.khodadadi23@yahoo.com
thanks alot
seju is offline   Reply With Quote

Old   April 8, 2014, 18:47
Default
  #85
Member
 
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 17
ovie is on a distinguished road
Quote:
Originally Posted by seju View Post
hi ovie
I have same problem can you send me too.
my Email is :sajad.khodadadi23@yahoo.com
thanks alot
Not sure what problem you are referencing. Can you please be more specific?
ovie is offline   Reply With Quote

Old   April 9, 2014, 02:54
Default
  #86
Member
 
sajad
Join Date: Aug 2013
Posts: 71
Rep Power: 13
seju is on a distinguished road
Quote:
Originally Posted by ovie View Post
Not sure what problem you are referencing. Can you please be more specific?
thanks ovie for reply.
I wanna compile incomprissileTwoPhaseThermalMixture at frist but I cant do that.
can you help me how can I compile that?
my problem similar the Thread 53.
this is my mail: sajad.khodadadi23@yahoo.com
thanks a lot
Sajad
seju is offline   Reply With Quote

Old   April 30, 2014, 06:24
Default
  #87
New Member
 
zhanglei
Join Date: May 2013
Location: China
Posts: 19
Rep Power: 13
becklei is on a distinguished road
hi ovie,

I try to add the energy equation to my interFoam, which is used to simulate the polymer injection process. I have implemented the two mentioned energy equation, and both results are still undesirability. let me introduce my code:

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

In my code, this equation is written as:
fvm::ddt(rho,T) +fvm::div(rhoPhi,T)-fvm::laplacian((kappa/Cp),T)==(mu/Cp)*magSqr(fvc::grad(U))
1) rho and rhoPhi is created in the createFields.H just like the source code, and surfaceScalarField rhoPhi is updated after the alphaEqn.H
2) Kappa is the mixture value of the two phase(liquid, Kappa1 [1 1 -3 -1 0 0 0 ] 0.18/air kappa2 [1 1 -3 -1 0 0 0 ] 0.03), volScalarField kappa=alpha1*kappa1+alpha2*kappa2.
3) Cp is also the mixture value, and Cp1 [0 2 -2 -1 0 0 0 ] 3100/Cp2 [0 2 -2 -1 0 0 0 ] 1000. volScalarField Cp=alpha1*Cp1+alpha2*Cp2.
4) volScalarField mu = twoPhaseProperties.mu()

In my case, the inlet temperature is 513K(fixedvalue), and the wall is 323K(fixedvalue). I choose Gauss upwind for div(rhoPhi,T), and Gauss linear corrected for laplacianSchemes.

The result shows that the max temperature is about 900K at the first step near the interface, and it reduces to the normal value 513K after 1/3 computation time. What’s more, I also change the kappa/Cp in the energy diffusion term from volScalarField to surfaceScalarField by interpolate(Kappa) and interpolate(Cp), and the result has no change.

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

In my code, this equation is written as:
fvm::ddt(rhoCp,T) +fvm::div(rhoPhiCp,T)-fvm::laplacian(kappa,T)==mu*magSqr(fvc::grad(U))

1) volScalarField rhoCp and surfaceScalarField rhoPhiCp is created like your code. rhoCp is updated after rho in the alphaEqnSubCycle.H by rhoCp = alpha1*rho1*cp1 + alpha2*rho2*cp2, rhoPhiCp is updated after rhoPhi in the alphaEqn.H by rhoPhiCp = phiAlpha*(rho1*cp1 - rho2*cp2) + phi*rho2*cp2.
2) kappa and mu is also the mixture value like the equation 1.

In my case, I choose Gauss upwind for div(rhoPhiCp,T), and other set is same as the first case above.

The result shows that the max temperature is about 3000K at the first step on the front of interface(in the air area), and it Increase to inf. after about 1/4 computation time.

After run the two different equations, the first one shows better convergence ability, but my code still cannot get a satisfactory result. I think the wide difference of properties of the too phases not only blows up the convective term but also blows up my head!!! Can you help me with error correction or improvement suggestions? Thanks in advance!
pmdelgado2, amolrajan and tonnykz like this.
becklei is offline   Reply With Quote

Old   May 3, 2014, 01:56
Default add TEqn.H
  #88
New Member
 
zhanglei
Join Date: May 2013
Location: China
Posts: 19
Rep Power: 13
becklei is on a distinguished road
@ovie

A quite simple question:In your code, you add the TEqn.H after UEqn.H. Why not after the PISO loop just like the tutorial( "How to add temperature to icoFoam")?
becklei is offline   Reply With Quote

Old   May 3, 2014, 06:02
Default
  #89
Member
 
sajad
Join Date: Aug 2013
Posts: 71
Rep Power: 13
seju is on a distinguished road
Quote:
Originally Posted by becklei View Post
@ovie

A quite simple question:In your code, you add the TEqn.H after UEqn.H. Why not after the PISO loop just like the tutorial( "How to add temperature to icoFoam")?
Dear Becklei because interFoam used the pimple loop and its different with piso, and for added TEqn you can't do that similar add TEeqn into icoFoam. you must do that for two phase at the same time.
seju is offline   Reply With Quote

Old   May 3, 2014, 06:29
Default
  #90
New Member
 
zhanglei
Join Date: May 2013
Location: China
Posts: 19
Rep Power: 13
becklei is on a distinguished road
Quote:
Originally Posted by seju View Post
Dear Becklei because interFoam used the pimple loop and its different with piso, and for added TEqn you can't do that similar add TEeqn into icoFoam. you must do that for two phase at the same time.
Hi, sajad!

Thanks for your reply!
I will try to understand the PIMPLE loop by myself.
Can you give me some detail explain about the difference between TEqn and TEeqn?

Thanks again for your patience to the novice!
becklei is offline   Reply With Quote

Old   July 11, 2014, 10:01
Default
  #91
Member
 
sajad
Join Date: Aug 2013
Posts: 71
Rep Power: 13
seju is on a distinguished road
dear foamer,
I know this post write for many time ago,but I face to this problem right now, I wanna simulation rising bubble with temp, following this boundary conditions:
upper wall 312k and else is zeroGradient and my box have 298k. after few iteration bubble temp be 400k or more and temp unbunded. can you help me plz? how can I solve this problem?
I added energy equation to interFoam following example in this trend,do you have any suggestion for solve this probplem.
Best regards, Sajad
seju is offline   Reply With Quote

Old   August 29, 2014, 10:38
Default
  #92
New Member
 
Peter
Join Date: Apr 2014
Posts: 21
Rep Power: 12
John Degenkolb is on a distinguished road
Hi Foamers,

I found some great tutorial slides for the implementation of heat transfer to interFoam in Openfoam version 2.3.0:

http://www.wolfdynamics.com/images/conf_and_publ/interTempFoam.pdf

the source code is published as well:
http://www.wolfdynamics.com/images/conf_and_publ/source_interTempFoam.tar.gz

Thanks to Damiano Natali and wolf dynamics !!!


The implementation, compiling and running work well, but my results show some strange behavior:
The initial temperature field involves values between 0 K and 300 K. After some steps, however, the temperature range is from around -30 K to 340 K. The negative values can be found near high temperature gradients. In the end of the simulation, the temperature is between -1 K and 20 K.

I tried the following without really changing anything:

1. The procedure described in Ovie’s post: http://www.cfd-online.com/Forums/openfoam-solving/69103-diverging-result-temperature-field-interfoam-2.html#post264901 (thanks!)
2. Changing the temperature range to 1K to 300K
3. Reducing and increasing the specific heat
4. Reducing and increasing the density
5. Reducing the solver tolerances in fvSolution
6. Mesh refinement
7. Reducing maxCo, maxAlphaCo and maxDeltaT in the controlDict. (While compiling the solver, I got the warning that maxDeltaT is an unused variable)

When I …

… set up the case in a way, that no convection, only diffusion occurs, then temperature stays bounded.

… reduce the initial temperature range to (0 K to 20 K) the “over swing” (how is this called in English?) reduces to +-2K.

… reduce the Prandtl number, which is used to calculate the heat conductivity, the temperature equalization in the domain is very quick, hence the gradient is reduced very fast and the “over swing” is reduced.

What else can I do in order to bound the temperature of my simulation?

Thank you in advance!
snak, Kummi and EliB like this.
John Degenkolb is offline   Reply With Quote

Old   September 1, 2014, 11:51
Default
  #93
New Member
 
rama13's Avatar
 
Damiano Natali
Join Date: Mar 2013
Location: Genova, Italy
Posts: 17
Rep Power: 13
rama13 is on a distinguished road
Hi Peter,

Quote:
Originally Posted by John Degenkolb View Post
I found some great tutorial slides for the implementation of heat transfer to interFoam in Openfoam version 2.3.0:

http://www.wolfdynamics.com/images/conf_and_publ/interTempFoam.pdf

the source code is published as well:
http://www.wolfdynamics.com/images/conf_and_publ/source_interTempFoam.tar.gz


The implementation, compiling and running work well, but my results show some strange behavior:
The initial temperature field involves values between 0 K and 300 K. After some steps, however, the temperature range is from around -30 K to 340 K. The negative values can be found near high temperature gradients. In the end of the simulation, the temperature is between -1 K and 20 K.
You are right, T values gets out of the possible range in a few iterations and then go to convergence. It seems when we did the tutorials we focused on making everything working and not on physics

Maybe there are some other ways to bound your values, but this problem can be solved by using another scheme for computing div(rhoCpPhi,T).

For example look in attachment what happens to min/max values of T by changing div(rhoCpPhi,T) from Gauss linearUpwind grad(T) to Gauss limitedLinear 1.

There are a lot of possible schemes in OF, have a look for instance here!

Best regards,
Damiano
Attached Images
File Type: jpg minMax.jpg (36.0 KB, 148 views)

Last edited by rama13; September 1, 2014 at 11:58. Reason: misspell
rama13 is offline   Reply With Quote

Old   March 25, 2015, 11:20
Question
  #94
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Dear Foamers,

I have been suffering for two days with this same thing.
I added the energy equation as developed by Ovie making some changes to adapt with OF2.3.0, but it didn't work and just today i saw the work done by wolfdynamics
well! it is like a copy of my work ( or mine a copy of theirs) exactly, with some points missing in the slide provided, like adding the line
tmp<surfaceScalarField> kappaf() const;
in the incompressibleTwoPhaseMixture.H file
So, more presicely, what iv done is i added
Foam::tmp<Foam::surfaceScalarField>
Foam::incompressibleTwoPhaseMixture::kappaf() const
{
const surfaceScalarField alpha1f
(
min(max(fvc::interpolate(alpha1_), scalar(0)), scalar(1))
);

return tmp<surfaceScalarField>
(
new surfaceScalarField
(
"kappaf",
(
alpha1f*rho1_*cp1_*(1/Pr1_)*fvc::interpolate(nuModel1_->nu())
+ (scalar(1) - alpha1f)*rho2_*cp2_*(1/Pr2_)*fvc::interpolate(nuModel2_->nu())
)
)
);
}
to incompressibleTwoPhaseMixture.C file
and added cps and Prs in .H file and tmp..... like defined above
and the library is compiled perfectly

in my solver i added the TEqn
where the 1st line is
surfaceScalarField kappaf = twoPhaseProperties.kappaf();

but when i compile my solver it gives my the following massage:

/home/alkebsi/OpenFOAM/alkebsi-2.3.0/applications/solvers/interThermalFoam/TEqn.H:1: référence indéfinie vers « Foam::incompressibleTwoPhaseMixture::kappaf() const »
collect2: error: ld returned 1 exit status
make: *** [/home/alkebsi/OpenFOAM/alkebsi-2.3.0/platforms/linux64GccDPOpt/bin/interThermalFoam] Erreur 1

the system is french but i think it is clear what (référence indéfinie vers) means (undefined reference)


well! stupidly i tried to comment the part in .C file where the method kappaf() is defined, recombiled the library successfully and when i combile the solver it shows the same error. As if he cant access it wether it is there or not
kebsiali is offline   Reply With Quote

Old   March 26, 2015, 04:54
Default
  #95
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
sorry
found my stupid mistake

I did not specify the new library in make/options
and the solver was looking for the method kappaf() in the original library

now it is working
thanks for passing by
kebsiali is offline   Reply With Quote

Old   June 30, 2015, 15:45
Default
  #96
New Member
 
Manuel do Nascimento
Join Date: May 2012
Posts: 14
Rep Power: 14
MdoNascimento is on a distinguished road
Hello. I have a question about adding the temperature to the interFoam solver with the methods discussed in this thread.

Where exactly are the condition of heat flux continuity of the interface implemented? Can I see those directly in the code?

Something like k1*dT1/dn = k2*dT2/dn.

Thanks
MdoNascimento is offline   Reply With Quote

Old   June 30, 2015, 16:06
Default
  #97
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Dear Manuel

in VOF method there is no T1 and T2
there is only T of the effective fluid.
I get your point, sperious or parasite fluxes could start from one fluid to the other through the interface, and something like the compression term in the alpha equation should be added.
the solver discussed here however gives good results, with the use of vanleer scheme for the flux term.
kebsiali is offline   Reply With Quote

Old   June 30, 2015, 16:21
Default
  #98
New Member
 
Manuel do Nascimento
Join Date: May 2012
Posts: 14
Rep Power: 14
MdoNascimento is on a distinguished road
Quote:
Originally Posted by kebsiali View Post
Dear Manuel

in VOF method there is no T1 and T2
there is only T of the effective fluid.
I get your point, sperious or parasite fluxes could start from one fluid to the other through the interface, and something like the compression term in the alpha equation should be added.
the solver discussed here however gives good results, with the use of vanleer scheme for the flux term.
Hello kepsiali,

you are right, there is no specific T for each phase in this solver. I should have known this ...

But still, is the condition fullfilled somehow, somewhere?

I could ask the same for the shear stresses of both phases at the interface.
MdoNascimento is offline   Reply With Quote

Old   July 31, 2015, 16:33
Default
  #99
New Member
 
Behzad
Join Date: Nov 2014
Posts: 7
Rep Power: 12
behcfd is on a distinguished road
Hi all,

I have followed the similar steps as given in this post by Ovie to add energy equation to interFoam.I use openFOAM2.3. first I compiled new library in src/incompressible/incompressibleTwoPhaseMixture without any error. after that I wanted to implement new solver. But this error occured:

/home/beh/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/fvmLaplacian.C:322:1: note: template argument deduction/substitution failed:
In file included from myinterFoam.C:97:0:
TEqn.H:6:30: note: ‘Foam::surfaceScalarField {aka Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>}’ is not derived from ‘const Foam::tmp<Foam::GeometricField<GType, Foam::fvsPatchField, Foam::surfaceMesh> >’
- fvm::laplacian(kappaf, T)
^
In file included from myinterFoam.C:62:0:
/home/beh/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
scalar maxDeltaT =
^
make: *** [Make/linux64GccDPOpt/myinterFoam.o] Error 1

I would be thankful if you help me
behcfd is offline   Reply With Quote

Old   June 29, 2017, 11:12
Default nice to meet u
  #100
New Member
 
wangyuhang
Join Date: Apr 2017
Posts: 3
Rep Power: 9
262554842@qq.com is on a distinguished road
Quote:
Originally Posted by metro View Post
Hey Ovie,

I have implemented your code and I am now having stability issues. When I run my case, the temperature diverges and ends up reaching inf. I tested the case/boundary conditions with interFoam and no issues. When it came to implementing the div(rho*phi*cp,T) in fvScheme, I used a standard linear Gaussian discretisation. Is this correct? Or did you utilise another methodology? Can you think of any other reason why this is happening?

Regards

Metro
hello ,i am new to use openfoam,and i also study about phase change(vapour to water).
firstly,im changing interFoam to interTemFoam some days.... failed failed failed ,sad....may i ask u a question?


surfaceScalarField rhoPhiCpf
(
IOobject
(
"rhoPhiCpf",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
rhoPhi*cp1
);



why the last line "rhoPhi*cp1"?what's meaning?
262554842@qq.com is offline   Reply With Quote

Reply

Tags
interfoam energy, temperature field


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 21:28.