CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   uniform heating of fluid region (https://www.cfd-online.com/Forums/openfoam-solving/74434-uniform-heating-fluid-region.html)

santoo_cfd March 31, 2010 13:09

uniform heating of fluid region
 
Hi,

I am using bousinesqBuoyantSimpleFoam to model a heat exchager. I would like to give uniform heating to whole fluid region as a source term (volumetric heating in W/m^3). Can anybody suggest me how to do this in OpenFOAM.

Regards
Santhosh.

santoo_cfd April 5, 2010 06:29

Doubt regd TEqn.H
 
I am looking at the TEqn.H in boussinesqBuoyantSimepleFoam. following is snippet copied from the above file.
Code:

fvScalarMatrix TEqn
    (
        fvm::div(phi, T)
      - fvm::Sp(fvc::div(phi), T)
      - fvm::laplacian(kappaEff, T)
    );

Can anybody tell me what is the need of second term
Code:

fvm::Sp(fvc::div(phi), T)
according to following relation
Code:

div(sV) = sdiv(V)+V.grad(s)
(s is scalar and V is vector).

Combination of first two terms will results in the following,
Code:

phi.gradT
Can anybody help me understanding these equations. I am finally trying to find heat source term in the equation so that I can specify uniform heating thoughout the fluid region.

Regards
Santhosh.

santoo_cfd April 6, 2010 06:52

I have added the source term in the TEqn.H as below.
Code:

fvScalarMatrix TEqn
    (
        fvm::div(phi, T)
      - fvm::Sp(fvc::div(phi), T)
      - fvm::laplacian(kappaEff, T)
      - Q/(rho0*cp0)
    );

I have compiled and run the some simple test case. I have not yet seen the results just run completed successfully.

I will post back if there is any other alternative.

Regards
Santhosh

olhe0002 April 7, 2010 11:09

That sounds interesting.

Please let us know, if you have some results.

Regards.

santoo_cfd May 11, 2010 01:10

Hi Oli,

That seems to be working, I am solving very big heat exchanged problem, As for as residuals and priliminary results I am not facing any major problem (Compared to the one without source terms).

The only thing I am worried about is Eugene's following post..

http://www.cfd-online.com/Forums/ope...-new-post.html

I am also finding many problems with these set of solvers, especially convergence of Temperature is very very slow. forget about second order results (Remember I am a novice user still, and I think I am continue to be novice as long as openfoam does not provide documentation)

I am doing lot of parametric study (Thanks to my organization for proving me the infinite compute power on world's faster super computer, EKA)

Regards
Santhosh

santoo_cfd May 11, 2010 01:50

Sensitivity of Turbulent prandtl number
 
1 Attachment(s)
Hi,

Please look at the residual file attached here,

Unknowingly I initially used the turbulent Prandtl number (Prt) equals 5. After reading the documentation I came to know Prt is used as a contribution to production term in turbulent kinetic energy equation. Also for k-e model it has to be aroung 0.85.

So I changed the value of Prt to 0.8 from 5. I observed lot of variation in residue plots.

In the attached plot, sensitivity with viscosity (which I changed matching experimental) and Prt. The results are similar in case of variation of viscosity (although very little change). But with variation of Prt I found completely different residual.

I am using upwind numerical schemes for interpolation.

Please can anybody through a light on the use of Prt. Is it okey to use Prt=5 if not can you suggest chages to get residual down.

I have observed simular variation in residual for other parameteers also.

Thanks
Santhosh

maddalena June 28, 2010 10:58

Hi Santhos,
I am new on heat transfer problems using cfd and I would like to model a constant volume heat generation, following the approach you proposed, since it seems to me that there is no already implemented function to model it in OF. Before starting, I would like to know it you have some results showing that this is a good approach, i.e. cfd matches with experimental results.
regards,

mad

santoo_cfd June 29, 2010 06:14

Hi,

I have added source term as I have mentioned above. I have even completed one test case with the modified solver. But unfortunately, I have not compared the results with the any benchmark case. Qualitatively It seemed OK to me.

If you find any benchmark cases to test it, please let me know, and I am happy to test it for you.

Regards,
Santhosh

maddalena July 16, 2010 11:17

Hi Santhosh,
finally I included the heat source contribution on chtMRFoam, as you suggested above. However, as explained here, the new solver gives acceptable values only if I use a single region. In the case of multiple region, of which only one is heated, the solver does not perform well.
I am thinking that this may be due to the coupling between the regions. Have you any experience in that? Any suggestion is welcome.
Regards,

mad

maddalena July 19, 2010 10:53

adding term in solidWallMixedTemperatureCoupled
 
Hi all,
trying to find an explanation on the strange results of my cht simulation including heat source, I ended up with the following:

solidWallMixedTemperatureCoupled in OF 1.6.x and 1.7 implements a coupling that differs from OF 1.6 and previous. In OF 1.6 (code):
Code:

    forAll(*this, i)
    {
        // if outgoing flux use fixed value.
        if (normalGradient()[i] < 0.0)
        {
            this->refValue()[i] = operator[](i);
            this->refGrad()[i] = 0.0;  // not used
            this->valueFraction()[i] = 1.0;
            nFixed++;
        }
        else
        {
            this->refValue()[i] = 0.0;  // not used
            this->refGrad()[i] = normalGradient()[i];
            this->valueFraction()[i] = 0.0;
        }
    }

while in OF 1.7 (code)
Code:

    this->refValue() = nbrIntFld;
    this->refGrad() = 0.0;
    this->valueFraction() = nbrKDelta / (nbrKDelta + myKDelta());

In any case, the two approach gives equal results for chtMultiRegionFoam so that is fine.
My doubts raise when applying a heat source. The 1D steady state conduction equation + heat source says that: dT2/dx2 + H/K = 0. Integrating once gives dT/dx - H/K*x = 0. It means that, in the case of an heat source refGrad is not equal to zero, but it is proportional to the heat souce itself.
For this reason, I am thinking to modify the solidWallMixedTemperatureCoupled to include this contribution as well. K is already read into solidWallMixedTemperatureCoupled.C, and I can easily modify the solver to read H as well. What I am missing is how to get the size of the cell normally to the coupling interface.
Is there anyone that can confirm my approach? anyone that can help me to understand how to get the cell size?
thanks in advance from any suggestion I may get.
cheers,

mad

Anne Lincke September 12, 2011 10:41

Hey Santhosh,


Quote:

Originally Posted by santoo_cfd (Post 253170)
I am looking at the TEqn.H in boussinesqBuoyantSimepleFoam. following is snippet copied from the above file.
Code:

fvScalarMatrix TEqn
    (
        fvm::div(phi, T)
      - fvm::Sp(fvc::div(phi), T)
      - fvm::laplacian(kappaEff, T)
    );

Can anybody tell me what is the need of second term
Code:

fvm::Sp(fvc::div(phi), T)
according to following relation
Code:

div(sV) = sdiv(V)+V.grad(s)
(s is scalar and V is vector).

Combination of first two terms will results in the following,
Code:

phi.gradT
Can anybody help me understanding these equations. I am finally trying to find heat source term in the equation so that I can specify uniform heating thoughout the fluid region.

Regards
Santhosh.

I just read your post and asked myself the same question a while ago.
I think I am now able to answer the question.
Basically we have the term
d/dxj (rho * u_j * T)
which includes the density.
This term goes to
d/dxj (rho * u_j * T) = rho * d/d_xj ( u_j * T) + u_j* T * d rho /dxj
The first term equals to
HTML Code:

fvm::div(phi, T)
The second term includes the derivative of the densitiy, rho.
From the continuity equation we know

d/dxj (rho * uj)=0
According to product rule
d/dxj (rho * uj ) = uj * d rho/dxj + rho * duj/dxj =0
and therefore
uj * d rho / dxj = - rho * duj/dxj

Therefore the second term becomes
u_j* T * d rho /dxj = - T * rho * duj/dxj

Which is in OF the term

HTML Code:

fvm::SuSp(-fvc::div(phi), T)
as everything is divided by density.
The additional term is zero for incompressible flows.

santoo_cfd September 12, 2011 23:44

Thanks for your effort in neatly explaining. Actually a while ago, My professor cleared my doubt about post. Sorry I forgot to post it back to forum. The explanation was similar to the one you explained.

Thanks again
Santhosh

himanshu28 September 18, 2013 04:02

some error
 
Quote:

Originally Posted by santoo_cfd (Post 253311)
I have added the source term in the TEqn.H as below.
Code:

fvScalarMatrix TEqn
    (
        fvm::div(phi, T)
      - fvm::Sp(fvc::div(phi), T)
      - fvm::laplacian(kappaEff, T)
      - Q/(rho0*cp0)
    );

I have compiled and run the some simple test case. I have not yet seen the results just run completed successfully.

I will post back if there is any other alternative.

Regards
Santhosh

Hi,

I used user idea for building the source term in my solver and i specify Q as volumetric heat source dimension my solver is compiling properly but when i am using the solver it is giving me some kind of dimension error i am not able to debug it if you can help.

Code:

Different dimensions for =
    dimensions : [0 2 -1 0 0 0 0] = [0 4 -3 0 0 0 0]


    From function dimensionSet::operator=(const dimensionSet&) const
    in file dimensionSet/dimensionSet.C at line 165.

Thank you.

ashghan June 5, 2014 08:18

Can any of you tell me How to implement the volumetric source term in 'buoyantSimpleFoam'?

Tellur March 17, 2016 22:18

Hello,

I am reviving an old thread but I was wondering if anyone has any insights on this one.

I am trying to do exactly what the above posters intended, adding a volumetric heat source term to buoyantboussinesq solver.

Unfortunately, adding the source term in the Teqn file does not work, as the solver does not recognize the Q term (I also had to change rho to rhok, hope that is correct).

I realize that the field Q is not recognized, do I also need to add it in the createFields dictionary?

Forgive my ignorance, new at adjusting solvers :(

Thank you so much in advance.

Kind regards,
Theodore.

----

Hello,

Reviving an old thread in the hope of people still being around. i'm trying to add the heat source term in the same solver without much success.

Anyone has a more detailed approach as to how this was implemented (i.e. the Q/(rho*cp) term).

Thanks in advance.

Theodore.

Anne Lincke March 18, 2016 03:32

Dear Theodore,

you need to declare it in createFields.H. You should do it accordingly to the other fields which are declared in there.

It would be easier, though, to understand your problem if you could post your code and the error message.

Kind Regards
Anne


All times are GMT -4. The time now is 20:37.