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

constant heat flux boundary

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 7, 2019, 23:04
Default constant heat flux boundary
  #1
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 9
calf.Z is on a distinguished road
Hi,

I am using externalWallHeatFluxTemperature BC and choose mode q to give constant heat flux on the wall.

After running the case, I am using wallHeatFlux tools to check the q. But what confused me is that it gives the min/max/integral value and min/max is different and their value is different from the setting value.

So I am confused that if I set constant q, the checking result should be the same as I set. But it did not.

I am using tabulated table to obtain the thermopropertites. So kappa/Cp/mu
is changing with temperature. I do not know if it will influence the BC.

Any hint is highly appreciated.
calf.Z is offline   Reply With Quote

Old   March 11, 2019, 15:29
Default
  #2
Member
 
Arvind Jay
Join Date: Sep 2012
Posts: 97
Rep Power: 15
arvindpj is on a distinguished road
Hi,

I don't see any discrepancy between the heat flux set in externalWallHeatFluxTemperaure bc and the one computed from the wallHeatFlux postProcess utility. I earlier had issues with of1812 switching to of6 solved it.

Cheers,
Jay
arvindpj is offline   Reply With Quote

Old   March 12, 2019, 09:04
Default
  #3
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 9
calf.Z is on a distinguished road
Quote:
Originally Posted by arvindpj View Post
Hi,

I don't see any discrepancy between the heat flux set in externalWallHeatFluxTemperaure bc and the one computed from the wallHeatFlux postProcess utility. I earlier had issues with of1812 switching to of6 solved it.

Cheers,
Jay
Thank you for replying.

If I use constant thermoPhysicalProperties or the thermoProperties are not changing much, the checking result by wallHeatFlux is the same as the setting one in BC.

However, if the thermoPhysicalProperties are changing with temperature rapidly, the checking result is different with the setting one.

Kappa is not constant and I do not know if it affects the result. In the code:
Code:
        case fixedHeatFlux:
        {
            refGrad() = (q_ + qr)/kappa(Tp);
            refValue() = 0;
            valueFraction() = 0;
Any hint is highly appreciated.
calf.Z is offline   Reply With Quote

Old   March 12, 2019, 10:26
Default
  #4
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 15
simrego is on a distinguished road
Hi!


If you have a converged solution they should be the same!
If your case is not converged they can be different.
In the equations you are using the temperature gradient which is calculated from the defined flux. So during the solution (correct me if I'm wrong), you do something like this:

You set the gradient using the current kappa -> you get the new temperature field. In the post-processing step you calculate the heat flux with this temperature field where you have a new kappa (temperature dependent kappa). Since you use 2 different kappa you'll have 2 different results.
If you have a converged solution, the kappa used for the gradient is the same as the kappa used for the flux calculation in the post-processing step so you have to get back the heat flux what you have defined in the BC.
simrego is offline   Reply With Quote

Old   March 12, 2019, 22:43
Default
  #5
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 9
calf.Z is on a distinguished road
Quote:
Originally Posted by simrego View Post
Hi!

You set the gradient using the current kappa -> you get the new temperature field. In the post-processing step you calculate the heat flux with this temperature field where you have a new kappa (temperature dependent kappa). Since you use 2 different kappa you'll have 2 different results.
If you have a converged solution, the kappa used for the gradient is the same as the kappa used for the flux calculation in the post-processing step so you have to get back the heat flux what you have defined in the BC.
Thank you for replying! You gave some hints for me.

I check the code of wallHeatFlux, it calculate heat flux by:

Code:
    
surfaceScalarField heatFlux
    (
        fvc::interpolate(alpha)*fvc::snGrad(he)
    );
The code does not have kappa, but is it related to kappa by using k*grad(T)=alpha*h? However, Cp in my case is changing strongly with temperature. I think the transformation of k*grad(T)=alpha*h need the linear assumption.

Or maybe they calculate q in different ways so different results happen.

I am now using tabulated method so the thermoPhysicalProperties are read from tabulated table.

When I test water where thermoPhysicalProperties is not changing strongly, the heat flux checking result is fine. But when I test supercritical CO2 with strongly-changed properties, The result seems confusing.

Any hint is highly appreciated.

Regards,
Calf.Z
calf.Z is offline   Reply With Quote

Old   March 13, 2019, 08:10
Default
  #6
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 15
simrego is on a distinguished road
Okay It is a bit tricky. I should check in the code but I tried to figure out this a long time ago and if I'm remember well, kappa is inherited from the thermal model, so what is kappa actually is depends on the thermal model. Solid thermo, fluid thermo(const, sutherland, etc.) So you can check it for yourself in the doxygen for your case what is kappa exactly.


But anyways. With a converged case your flux have to be fine. Maybe your case is not converged. Check some physical quantities, not residuals. Or maybe monitor the min and max value of the heatFlux. If it is oscillating you need more iterations. If it is oscillating try to use a little relaxation in the hEqn. When everything is dependent of the temperature, It can be hard to reach a converged solution.
simrego is offline   Reply With Quote

Old   March 13, 2019, 09:34
Default
  #7
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 9
calf.Z is on a distinguished road
Quote:
Originally Posted by simrego View Post

Or maybe monitor the min and max value of the heatFlux. If it is oscillating you need more iterations. If it is oscillating try to use a little relaxation in the hEqn. When everything is dependent of the temperature, It can be hard to reach a converged solution.
Thank you for your kind help!

I am using tabular table to read thermoproperties which are changed with T. So I modify the code of rhoThermo to create a new library which can meet the function of tabular table. So I am not sure if kappaMethod : fluidThermo is suitable for my case.

I have monitored the min and max value of the heatFlux. For the normal result, min and max should be the same and they are both equal to the setting one in BC, is it right? For my case, min and max are different and they form the range.

The residual of H is stay constant and the case meet the mass balance and energy balance. So I stop it to have a check. Maybe I should lower the residual standard to have more iterations.
calf.Z is offline   Reply With Quote

Old   March 13, 2019, 09:45
Default
  #8
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 15
simrego is on a distinguished road
And what if you create a polynomial which is fit your data (10 sec work in excel) and use polynomial thermal properties. So you don't have any "tricks" involved.


I don't think if there is a bug in the code. At least I had no problem with it.
simrego is offline   Reply With Quote

Old   March 13, 2019, 13:10
Default
  #9
Member
 
Arvind Jay
Join Date: Sep 2012
Posts: 97
Rep Power: 15
arvindpj is on a distinguished road
Here is the icoPoly for Water

Code:
 

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  plus                                  |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       polynomial;
    thermo          hPolynomial;
    equationOfState icoPolynomial;
    specie          specie;
    energy          sensibleEnthalpy;
}

dpdt off;

mixture
{
    specie
    {
        molWeight   18;
    }
    equationOfState
    {
        rhoCoeffs<8> (838.46 1.4 -0.003 3.72e-07 0.0 0.0 0.0 0.0);          
    }
    thermodynamics
    {
        CpCoeffs<8> (12010.1 -80.4 0.31 -0.000538 3.62e-07 0.0 0.0 0.0);
        Hf          0; //Hf -286000.0;
        Sf          0;  //Sf 69.95;
    }
    transport
    {
        kappaCoeffs<8> (-0.869 0.00895 -1.58e-05 7.97e-09 0.0 0.0 0.0 0.0);
        muCoeffs<8> (0.0374 -3.093e-4 9.609e-7 -1.32e-9 6.746e-13 0 0.0 0.0);
    }
}


// ************************************************************************* //
arvindpj is offline   Reply With Quote

Old   March 13, 2019, 21:11
Default
  #10
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 9
calf.Z is on a distinguished road
Quote:
Originally Posted by simrego View Post
And what if you create a polynomial which is fit your data (10 sec work in excel) and use polynomial thermal properties. So you don't have any "tricks" involved.


I don't think if there is a bug in the code. At least I had no problem with it.
Is polynomial that easy? My simulation is about supercritical carbon dioxide which thermoProperties is changing strongly with T. Where can I learn about polynomial method? Thank you.
calf.Z is offline   Reply With Quote

Old   March 13, 2019, 21:13
Default
  #11
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 9
calf.Z is on a distinguished road
Quote:
Originally Posted by arvindpj View Post
Here is the icoPoly for Water

Code:
 

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  plus                                  |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       polynomial;
    thermo          hPolynomial;
    equationOfState icoPolynomial;
    specie          specie;
    energy          sensibleEnthalpy;
}

dpdt off;

mixture
{
    specie
    {
        molWeight   18;
    }
    equationOfState
    {
        rhoCoeffs<8> (838.46 1.4 -0.003 3.72e-07 0.0 0.0 0.0 0.0);          
    }
    thermodynamics
    {
        CpCoeffs<8> (12010.1 -80.4 0.31 -0.000538 3.62e-07 0.0 0.0 0.0);
        Hf          0; //Hf -286000.0;
        Sf          0;  //Sf 69.95;
    }
    transport
    {
        kappaCoeffs<8> (-0.869 0.00895 -1.58e-05 7.97e-09 0.0 0.0 0.0 0.0);
        muCoeffs<8> (0.0374 -3.093e-4 9.609e-7 -1.32e-9 6.746e-13 0 0.0 0.0);
    }
}


// ************************************************************************* //
Thank you. I will have a look at it. I am now simulating supercritical carbon dioxide.
calf.Z 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
Setting the height of the stream in the free channel kevinmccartin CFX 12 October 13, 2022 21:43
How do you use heat flux as a boundary condition in a non-wall area in UDF? JuBong Fluent UDF and Scheme Programming 2 July 2, 2018 21:15
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Constant Heat Flux Boundary Condition on Long Thin Pipe CGramlich SU2 3 April 22, 2013 08:25
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56


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