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

Understanding temperature coupling BCs

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

Like Tree52Likes
  • 13 Post By chriss85
  • 6 Post By chriss85
  • 2 Post By chriss85
  • 30 Post By Bloerb
  • 1 Post By Eslam Reda

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 28, 2014, 07:44
Default Understanding temperature coupling BCs
  #1
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 18
chriss85 will become famous soon enough
I'm currently trying to understand the boundary conditions for temperature coupling between two regions, namely compressible::turbulentTemperatureCoupledBaffleMix ed and compressible::turbulentTemperatureRadCoupledMixed (source files located in turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/ ). In the first BC, radiation is neglected and the problem thus simplifies. In the .C file, one finds the following comment:
Quote:
// Both sides agree on
// - temperature : (myKDelta*fld + nbrKDelta*nbrFld)/(myKDelta+nbrKDelta)
// - gradient : (temperature-fld)*delta
// We've got a degree of freedom in how to implement this in a mixed bc.
// (what gradient, what fixedValue and mixing coefficient)
// Two reasonable choices:
// 1. specify above temperature on one side (preferentially the high side)
// and above gradient on the other. So this will switch between pure
// fixedvalue and pure fixedgradient
// 2. specify gradient and temperature such that the equations are the
// same on both sides. This leads to the choice of
// - refGradient = zero gradient
// - refValue = neighbour value
// - mixFraction = nbrKDelta / (nbrKDelta + myKDelta())
I completely agree to and understand the value of the temperature on both sides of the patch. This is just a weighted average of the temperatures in the cells weighted with the heat conductivities divided by the length from center of the cell to the patch face.
I then assume that the gradient which is written here is only meant for the first side, and that the neighbour side is meant to be (temperature-nbrFld)*nbrDelta (possibly negative when the direction of the surface normal vector is considered).

Now the two strategies below are meant to be used in iterative solvers I suppose. Does anyone know how the second one can be derived from the formulas? Or is it somewhat empirically determined to accelerate convergence maybe?

For the second BC, things become more difficult because there are additional radiative heat fluxes, and no explaining comment. The strategy which is used here appears to be a bit different. The formulas used are:

, where o=owner, n=neighbour, Delta=distance between cell center and patch face, kappa heat conductivity and Qr radiative heat flux.

Does anyone understand this or has seen a derivative? I think this could be interesting for different heat transfer applications at boundaries.
chriss85 is offline   Reply With Quote

Old   October 31, 2014, 08:31
Default
  #2
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 18
chriss85 will become famous soon enough
I've spent some more time thinking about this. Using the equations above inserted into the mixed BC formula:
, here with 0: first region, 1: second region, so T0: temperature in first region cell, T_F_0: temperature in first region patch.
I'm wondering if the signs at the radiation fluxes are correct. For positive Q_r (meaning outgoing radiation) an iteration procedure using this formula is bound to diverge, because the sum of the two weighting factors in front of the temperatures is not 1???

As an example: Consider radiation coming out of a gas (0) being absorbed completely by a solid (1). In this case, Qr_0 > 0, Qr_1 = 0 and the sum of both factors is larger than 1. In my understanding this should result in an increasing temperature on each iteration.

I'm going to test this series one dimensionally with MATLAB to investigate the convergence properties. Does anyone have any better explanation for the reasoning behind these formulas or maybe a literature recommendation?
chriss85 is offline   Reply With Quote

Old   November 3, 2014, 11:06
Default
  #3
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 18
chriss85 will become famous soon enough
See http://www.cfd-online.com/Forums/ope...tml#post517173 for further results.
atulkjoy and Zhiheng Wang like this.
chriss85 is offline   Reply With Quote

Old   November 26, 2018, 00:20
Default
  #4
Member
 
Atul Kumar
Join Date: Dec 2015
Location: National Centre for Combustion Research and Development
Posts: 48
Rep Power: 10
atulkjoy is on a distinguished road
Quote:
Originally Posted by chriss85 View Post
I've spent some more time thinking about this. Using the equations above inserted into the mixed BC formula:
, here with 0: first region, 1: second region, so T0: temperature in first region cell, T_F_0: temperature in first region patch.
I'm wondering if the signs at the radiation fluxes are correct. For positive Q_r (meaning outgoing radiation) an iteration procedure using this formula is bound to diverge, because the sum of the two weighting factors in front of the temperatures is not 1???

As an example: Consider radiation coming out of a gas (0) being absorbed completely by a solid (1). In this case, Qr_0 > 0, Qr_1 = 0 and the sum of both factors is larger than 1. In my understanding this should result in an increasing temperature on each iteration.

I'm going to test this series one dimensionally with MATLAB to investigate the convergence properties. Does anyone have any better explanation for the reasoning behind these formulas or maybe a literature recommendation?



HI Hi chriss


Did you find a way to couple radiation of solid and gas phase. ????
atulkjoy is offline   Reply With Quote

Old   November 26, 2018, 00:24
Default Coupled Boundaries
  #5
Member
 
Atul Kumar
Join Date: Dec 2015
Location: National Centre for Combustion Research and Development
Posts: 48
Rep Power: 10
atulkjoy is on a distinguished road
Quote:
Originally Posted by chriss85 View Post
I've spent some more time thinking about this. Using the equations above inserted into the mixed BC formula:
, here with 0: first region, 1: second region, so T0: temperature in first region cell, T_F_0: temperature in first region patch.
I'm wondering if the signs at the radiation fluxes are correct. For positive Q_r (meaning outgoing radiation) an iteration procedure using this formula is bound to diverge, because the sum of the two weighting factors in front of the temperatures is not 1???

As an example: Consider radiation coming out of a gas (0) being absorbed completely by a solid (1). In this case, Qr_0 > 0, Qr_1 = 0 and the sum of both factors is larger than 1. In my understanding this should result in an increasing temperature on each iteration.

I'm going to test this series one dimensionally with MATLAB to investigate the convergence properties. Does anyone have any better explanation for the reasoning behind these formulas or maybe a literature recommendation?
Quote:
Originally Posted by chriss85 View Post
I'm currently trying to understand the boundary conditions for temperature coupling between two regions, namely compressible::turbulentTemperatureCoupledBaffleMix ed and compressible::turbulentTemperatureRadCoupledMixed (source files located in turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/ ). In the first BC, radiation is neglected and the problem thus simplifies. In the .C file, one finds the following comment:

I completely agree to and understand the value of the temperature on both sides of the patch. This is just a weighted average of the temperatures in the cells weighted with the heat conductivities divided by the length from center of the cell to the patch face.
I then assume that the gradient which is written here is only meant for the first side, and that the neighbour side is meant to be (temperature-nbrFld)*nbrDelta (possibly negative when the direction of the surface normal vector is considered).

Now the two strategies below are meant to be used in iterative solvers I suppose. Does anyone know how the second one can be derived from the formulas? Or is it somewhat empirically determined to accelerate convergence maybe?

For the second BC, things become more difficult because there are additional radiative heat fluxes, and no explaining comment. The strategy which is used here appears to be a bit different. The formulas used are:

, where o=owner, n=neighbour, Delta=distance between cell center and patch face, kappa heat conductivity and Qr radiative heat flux.

Does anyone understand this or has seen a derivative? I think this could be interesting for different heat transfer applications at boundaries.



Nice work Chriss
atulkjoy is offline   Reply With Quote

Old   November 26, 2018, 11:38
Default
  #6
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
At the interface between fluid and solid (or solid and solid) the following is true:

Q_s = -Q_f and T_s = T_f

This means, that the heat flux exiting one domain enters the other and that both regions agree on temperature.

The heat flux can be written as:

\kappa_s \nabla T_s=Q_s = -Q_f = -\kappa_f \nabla T_f

The gradient at the wall can be expressed as the difference between the value at the cell center and wall face devided by the distance between those. OpenFOAM uses the inverse of that however: \Delta=\frac{1}{\delta}.
\nabla T = \frac{T_c-T_f}{\delta}=\Delta(T_c-T_f)

From here it is only a bit of math. We summarize the above condition:

\kappa_s\Delta_s(T_{cs}-T_s)=-\kappa_f\Delta_f(T_{cf}-T_f)

and simplify with T_s = T_f=T_{wall}. This depends on the region you want to use the boundary condition for. For illustration we'll use the fluid side.

\kappa_s\Delta_s(T_{cs}-T_{f})=-\kappa_f\Delta_f(T_{cf}-T_{f})

\Rightarrow T_{f}= T_{cs}\left(\frac{\kappa_s\Delta_s}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right)+T_{cf}\left(\frac{\kappa_f\Delta_f}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right)

a mixed boundary condition in OpenFOAM is defined as follows:

T_f = \text{valueFraction}\cdot\text{refValue}+(1-\text{valueFraction})(T_c+\Delta\cdot\text{refGrad})

We can rewrite the above formula to match this:

\Rightarrow T_{f}= T_{cs}\left(\frac{\kappa_s\Delta_s}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right)+T_{cf}\left(1-\frac{\kappa_s\Delta_s}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right)

The actual implementation
Code:
    this->refValue() = nbrIntFld(); // This is T_s

    this->refGrad() = 0.0;

    this->valueFraction() = nbrKDelta()/(nbrKDelta() + myKDelta()); This is kappa*Delta
This is the derivation for the boundary condition.

For adding in heat fluxes due to radiation you'd slightly modify the initial set up
Q_s +Q_{rads}= -Q_f -Q_{radf}

I have however not referenced this to the code. And am unsure about the sign of the radiation flux definition in OpenFOAM, so this might differ. It should however be a starting point for understanding the code.

Last edited by Bloerb; November 27, 2018 at 03:05.
Bloerb is offline   Reply With Quote

Old   August 9, 2021, 16:06
Default
  #7
jmt
Member
 
Julian
Join Date: Sep 2019
Posts: 32
Rep Power: 6
jmt is on a distinguished road
Hi everyone, this is a very nice discussion. I am also working with this BC and am interested in a second-order formulation.

As written, the expression of flux continuity at the interface is \kappa_{\mathrm{fluid}} \left( \frac{\partial T}{\partial \mathbf{n}} \right)_{\mathrm{fluid}} = \kappa_{\mathrm{solid}} \left( \frac{\partial T}{\partial \mathbf{n}} \right)_{\mathrm{solid}}.

The derivatives are expanded via first-order differencing and the formulation is re-arranged for the interface temperature.

Has anyone had success with a second-order BC for this? For example, replacing the temperature derivative with a second-order upwind type expression and re-arranging for interface temperature. This would require the two wall-adjacent cells which I suppose could be tricky to obtain.

Thanks.
jmt is offline   Reply With Quote

Old   August 10, 2021, 00:01
Default
  #8
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
The case you described is not a boundary. Thee are inner faces with different values of kappa at both sides. The temperature simulation does not need anything more.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   August 10, 2021, 10:09
Default
  #9
jmt
Member
 
Julian
Join Date: Sep 2019
Posts: 32
Rep Power: 6
jmt is on a distinguished road
Thank you for your input piu58.

I was examining boundary coupling and compared chtMultiRegionFoam with an analytical solution for semi-infinite media. A grid convergence study revealed the convergence was first-order despite using second-order spatial discretization, which motivated me to examine the coupling.

The boundary condition is implemented and in fact hard-coded as a first-order scheme for interface temperature.
jmt is offline   Reply With Quote

Old   August 11, 2021, 09:59
Default
  #10
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 720
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Dear Julian,

I fail to understand your post as much as I would like to.

Are you sure that the scheme is only of first order only? How to you measure the order of the convergence? Are you sure that the order of convergence is not limited by first order schemes employed to discretize the convective terms in the equation?

The reason for raising this doubt is the fact that my limited understanding tells me that the first order discretization used to discretize the fluid/solid interface conditions (local discretization error) should *not* lower the order of the volumetric scheme (global discretization error) from second to first order (for details see book of Piet Wesseling among others).

Kind wishes, Domenico.
dlahaye is offline   Reply With Quote

Old   December 2, 2022, 01:14
Default Further explaination - Heat source
  #11
New Member
 
Eslam Reda
Join Date: Jun 2009
Posts: 19
Rep Power: 16
Eslam Reda is on a distinguished road
Quote:
Originally Posted by Bloerb View Post
.

The full BC including a heat source (G) is expressed as:


Q_s = -Q_f - G and T_s = T_f


\kappa_s \nabla T_s=Q_s = -Q_f - G = -\kappa_f \nabla T_f - G


\Delta=\frac{1}{\delta}.


\nabla T = \frac{T_c-T_f}{\delta}=\Delta(T_c-T_f)

\kappa_s\Delta_s(T_{cs}-T_s)=-\kappa_f\Delta_f(T_{cf}-T_f)  - G


T_s = T_f=T_{wall}.


\kappa_s\Delta_s(T_{cs}-T_{f})=-\kappa_f\Delta_f(T_{cf}-T_{f}) - G

\Rightarrow T_{f}= T_{cs}\left(\frac{\kappa_s\Delta_s}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right)+T_{cf}\left(\frac{\kappa_f\Delta_f}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right )+ \frac{G}{\kappa_s\Delta_s+\kappa_f\Delta_f}


\Rightarrow T_{f}=  T_{cs}\left(\frac{\kappa_s\Delta_s}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right)+T_{cf}\left(\frac{\kappa_f\Delta_f}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right  )+ \frac{G * \kappa_f\Delta_f / \kappa_f\Delta_f}{\kappa_s\Delta_s+\kappa_f\Delta_f}

\Rightarrow T_{f}=   T_{cs}\left(\frac{\kappa_s\Delta_s}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right)+\left(1 - \frac{\kappa_s\Delta_s}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right   ) *\left( T_{cf} + G /  \kappa_f\Delta_f \right)


a mixed boundary condition in OpenFOAM is defined as follows (mixedFvPatchField.C):


Field<Type>perator=

(

valueFraction_*refValue_

+ (1.0 - valueFraction_)

*(

this->patchInternalField()

+ refGrad_/this->patch().deltaCoeffs()

)

);


Hence,


T_f= Field<Type>perator


valueFraction_ = \left(\frac{\kappa_s\Delta_s}{\kappa_s\Delta_s+\kappa_f\Delta_f}\right)


refValue_ = T_{cs}


refGrad_ = \frac{G}{\kappa_f}


this->patch().deltaCoeffs() = \Delta_f
F42 likes this.
Eslam Reda is offline   Reply With Quote

Old   August 4, 2023, 07:48
Default
  #12
New Member
 
Join Date: Aug 2023
Posts: 1
Rep Power: 0
chicha is on a distinguished road
Do these formulation account for non-orthogonality of the face? If not, should they?
chicha is offline   Reply With Quote

Old   March 19, 2024, 06:54
Default
  #13
F42
New Member
 
Join Date: Jun 2018
Posts: 20
Rep Power: 7
F42 is on a distinguished road
Quote:
Originally Posted by chicha View Post
Do these formulation account for non-orthogonality of the face? If not, should they?

Yes, deltaCoeffs includes a orthogonality correction. See

https://openfoamwiki.net/index.php/O...n;;deltaCoeffs
F42 is offline   Reply With Quote

Reply

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
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 09:21
Static Temperature / Opening Temperature JulianP CFX 12 April 10, 2019 18:00
UDF for Back-flow Temperature G340 Fluent UDF and Scheme Programming 3 August 21, 2013 04:56
Fluent Ansys temperature coupling tensun Fluent UDF and Scheme Programming 0 November 14, 2010 05:30
high temperature in a coupling simulation sheintz STAR-CCM+ 3 September 30, 2010 13:56


All times are GMT -4. The time now is 15:59.