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

Flow with source term and compressible::turbulentTemperatureCoupledBaffleMix ed bc

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2017, 08:08
Default Flow with source term and compressible::turbulentTemperatureCoupledBaffleMix ed bc
  #1
New Member
 
Gerben Schooneveldt
Join Date: Jan 2017
Posts: 1
Rep Power: 0
Gerben is on a distinguished road
I am trying to solve a fluid in a solid container. The fluid is heated by a volumetric source term (an electromagnetic field, assumed to be constant in time but not homogeneous in space), causing the fluid to flow. The fluid should lose part of its heat to the surrounding solid. The temperature differences are fairly small, so I use the Boussinesq approximation. However, it turns out energy is not conserved.

My initial attempt was to use the following temperature equation for the fluid region:
Code:
fvScalarMatrix TEqn
(
    fvm::ddt(rho, T)
  + fvm::div(phi, T)
  - fvm::laplacian(alpha, T)
  ==
    fvc::Sp(source)
);
TEqn.solve();
and boundary condition compressible::turbulentTemperatureCoupledBaffleMix ed

Now, if I use the zeroGradient boundary condition between fluid and solid, so there is no heat exchange, I find that after 90 s, the thermal energy within the fluid region is 188 J, while integrating the provided power yields only 141 J.

If I remove the term fvm::div(phi, T) from the equation, the energy balance is correct, but evidently the temperature distribution does not take fluid into account anymore. The energy balance is also correct, if I split the equation like this:
Code:
fvScalarMatrix TEqn
(
    fvm::ddt(rho, T)
  + fvm::div(phi, T)
  - fvm::laplacian(alpha, T)
);
TEqn.solve();
fvScalarMatrix TsEqn
(
    fvm::ddt(rho, T)
  ==
    fvc::Sp(source)
);
TsEqn.solve();
However, if I understand it correctly, in this case T is updated only at the end of the time step, so after the second equation, meaning that the field T used in the second equation uses the same values as before the first equation; that is to say, it is the as if the TEqn equation is not there at all. If that is indeed correct, is there a way to update T in the mean time?

Moreover, when I then use the original boundary condition (compressible::turbulentTemperatureCoupledBaffleMi xed), there is heat flowing from the fluid region to the solid region, but the temperature in the fluid region is not affected. When I use the first TEqn (including the source term), the heat flow from the fluid to the solid region does affect the temperature in the fluid region, but there is still a nett energy production within the fluid.

Now, part of the problem seem to be in the implementation of the boundary condition. When I disable the source term and start with a homogeneously heated fluid (delta T is 5 K, compared to the solid), then after 10 s the heat lost by the fluid region is -529 J, whereas the heat gained by the solid is only 283 J. The amount gained by the solid appears to be correct. When I comment out the debug message in the turbulentTemperatureCoupledBaffleMixed source file, the heat transfer rate written to the log file is correct (and consistent with the energy gain in the solid region).

I am using OpenFOAM-2.2.x.

If anyone could give me a pointer how to solve this, that would be much appreciated.

Last edited by Gerben; January 19, 2017 at 18:45.
Gerben is offline   Reply With Quote

Reply

Tags
openfoam 2.2.x


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
Source Term due to evaporation in energy transport equation styleworker OpenFOAM Programming & Development 3 September 7, 2022 03:09
momentum source term zwdi FLUENT 14 June 27, 2017 15:40
Mismatch of mass flow rates after source term implementation in SU2 akshaydeshpande SU2 1 August 12, 2016 11:08
Two-phase flow, source term Artvandelay Main CFD Forum 10 January 12, 2014 07:40
Source term of multiphase flow in CFX44 youngan CFX 0 September 28, 2003 22:27


All times are GMT -4. The time now is 01:42.