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

Possible bug in chtMultiRegionFoam with 2 solids in contact?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2021, 04:07
Default [Solved]Possible bug in chtMultiRegionFoam with 2 solids in contact?
  #1
Member
 
JuanMi
Join Date: Nov 2017
Posts: 41
Rep Power: 8
keitaro7_14 is on a distinguished road
Hi,

I noticed a very strange behaviour in chtMultiRegionFoam. I prefer to share my question to the community before report a bug, because I could be wrong.

I have two solids (two squares) in contact. Very very simple. I want to know Temperature at t=200s.

All boundaries are zeroGradient except the right face, with fixed temperature.

Heat transfer is governed by the Heat Equation, where diffusivity is the key.

Solid 1 | Solid 2



Solid 1:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    type            heSolidThermo;
    mixture         pureMixture;
    transport       constIso;
    thermo          eConst;
    equationOfState rhoConst;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        nMoles      1;
        molWeight   100.02;   // [g/mol]
    }

    transport
    {
        kappa   10;        // [W/m/K]
    }

    thermodynamics
    {
        Hf      0;
        Cv      1000;        // [J/kg/K]
    }

    equationOfState
    {
        rho     2200;       // [kg/m^3]
    }
}

// ************************************************************************* //

Solid 2:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    type            heSolidThermo;
    mixture         pureMixture;
    transport       constIso;
    thermo          eConst;
    equationOfState rhoConst;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        nMoles      1;
        molWeight   100.02;   // [g/mol]
    }

    transport
    {
        kappa   10;        // [W/m/K]
    }

    thermodynamics
    {
        Hf      0;
        Cv      1000;        // [J/kg/K]
    }

    equationOfState
    {
        rho     2200;       // [kg/m^3]
    }
}

// ************************************************************************* //
Well, the result seems OK. I used an analytical expression to solve this problem for spherical coordinates, and it fits very well (using a mesh of two concentric spheres).

For this problem (regarding to the squares), I get this result from the log, when solver finishes.

Code:
Solving for solid region capa_2
DICPCG:  Solving for e, Initial residual = 0.0037510124, Final residual = 6.6981383e-07, No Iterations 3
Min/max T:333.83288 453
ExecutionTime = 0.27 s  ClockTime = 0 s
Now, I am going two change both, k and Cv in Solid 1, with the following values:
Solid 1:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    type            heSolidThermo;
    mixture         pureMixture;
    transport       constIso;
    thermo          eConst;
    equationOfState rhoConst;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        nMoles      1;
        molWeight   100.02;   // [g/mol]
    }

    transport
    {
        kappa   0.01;        // [W/m/K]
    }

    thermodynamics
    {
        Hf      0;
        Cv      1;        // [J/kg/K]
    }

    equationOfState
    {
        rho     2200;       // [kg/m^3]
    }
}

// ************************************************************************* //
Noticed that the thermal diffusivity is the same, so I should expect the same result. Now, the result of chtMultiRegionFoam when it finishes:

Code:
Solving for solid region capa_1
DICPCG:  Solving for e, Initial residual = 0.015590819, Final residual = 1.955389e-07, No Iterations 4
Min/max T:309.80765 371.48362

Solving for solid region capa_2
DICPCG:  Solving for e, Initial residual = 0.0090723273, Final residual = 8.2453758e-08, No Iterations 4
Min/max T:371.48425 453
ExecutionTime = 0.29 s  ClockTime = 0 s

The minimum temperature of the second block is changing!! Why? I tried to change de ddtScheme, size of the mesh, adjustTimeStep, the maxDi...impossible. I don't know if I am stupid or really there is a bug in OpenFOAM



I attach the case for OF-8, so you can test to change k and Cv mantaining the same thermal diffusivity.

Thank you so much!!
Attached Files
File Type: gz Rectangle.tar.gz (4.8 KB, 6 views)

Last edited by keitaro7_14; February 5, 2021 at 13:53.
keitaro7_14 is offline   Reply With Quote

Old   February 5, 2021, 13:19
Default
  #2
Member
 
JuanMi
Join Date: Nov 2017
Posts: 41
Rep Power: 8
keitaro7_14 is on a distinguished road
Well, as expected, I am the stupid here, and not the OpenFOAM developers. The problem here is that the problem is wrongly formulated. Let me explain.

When we have two solids in contact, we can model the problem like two solids of different properties in contact, or like a unique solid with variable thermal properties. It is fine, but we have to pay attention to the formulation.

I assumed that two solids can be modelled as a solid with variable diffusivity, and the equation governing his physical behaviours is the following:

\left(\frac{\partial T}{\partial t}\right)=-\frac{\partial}{\partial x}\left(\alpha \frac{\partial T}{\partial x}\right)

but it is wrong! Why? Well,the success of the analysis/modelling depends on many factors, but the basis is the correct application ofthe heat conduction theory which is more important in case of transient thermal processes. I paid attention to the tool (OpenFOAM), but not to the formulation.

Most of the cases we can assume that there is no movement, no force field at the surface, no volume heat generation, and the pressure is constant. Neither the density nor the thermal capacity are changing with the time. Taking into account these conditions, the simplified heat conduction equation will be as it follows

\rho c_{\mathrm{p}}\left(\frac{\partial T}{\partial t}\right)=-\frac{\partial}{\partial x}\left(k \frac{\partial T}{\partial x}\right)

Now, I can do a little transformation:

\left(\frac{\partial T}{\partial t}\right)=-\frac{1}{\rho c_{\mathrm{p}}}\frac{\partial}{\partial x}\left(k \frac{\partial T}{\partial x}\right)

But..Can I introduce \rho c_{\mathrm{p}} into the derivative? NO! Because they are not constant! My real model are two solids, with different thermal properties. If I assume one solid, \rho, c_{\mathrm{p}} and k change with the position. The correct formulation following this approach of one solid with variable thermal diffusivity should be as follows:

\rho c_{\mathrm{p}}\left(\frac{\partial T}{\partial t}\right)=-\frac{\partial}{\partial x}\left(\alpha \rho c_{\mathrm{p}} \frac{\partial T}{\partial x}\right)

And well...we should derivate new ODEs to solve the problem.

The other approach, with two solids, is the approach of OpenFOAM, and if we have two solids, we have a system of equations.

\rho_1 C_{p,1} \frac{\partial T}{\partial t}=-\frac{\partial}{\partial x}\left(k_1 \frac{\partial T}{\partial x}\right) 0\leq x \leq x_1
\rho_2 C_{p,2} \frac{\partial T}{\partial t}=-\frac{\partial}{\partial x}\left(k_2 \frac{\partial T}{\partial x}\right) x_1< x \leq x_2

and in the interface, we have

T(x_1)=T(x_2)

\dot{q}_{x_1}=\dot{q}_{x_2}

where

\dot{q}=-k \frac{\partial T}{\partial x}

I hope this will help other researchers who have the same doubts as me and the same errors. I also recommend consulting the following publication: https://doi.org/10.1007/s10973-018-7014-4

Last edited by keitaro7_14; February 8, 2021 at 12:02.
keitaro7_14 is offline   Reply With Quote

Reply


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
Dynamic contact angle issue: fluent UDF couldn't set the correct contact angle FelixJJ FLUENT 2 October 20, 2021 02:39
Meshing concentration for Contact stress study between two solids bolbol Structural Mechanics 4 February 4, 2020 16:04
Contact between 2 solids Ansys Workbench dadouxx ANSYS 0 June 15, 2016 10:22
chtMultiRegionFoam, conduction with a contact resistance between two solids romain.h OpenFOAM Running, Solving & CFD 1 October 8, 2013 01:25
chtMultiRegionFoam: heat transfer coefficient between solids brent OpenFOAM Running, Solving & CFD 0 November 1, 2012 08:22


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