CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Boundary conditions MultiRegionHeater (https://www.cfd-online.com/Forums/openfoam/125431-boundary-conditions-multiregionheater.html)

Barbara October 25, 2013 07:10

Boundary conditions MultiRegionHeater
 
Hi Foamers!
I'm new to OpenFoam and I'm working with multiRegionFoam. I've played correctly the tutorial multiRegionHeater but now I'm doing some changes. I'd like to set the T value of the heater to 500 K and delete the condition of the minY which is a fixed temperature. In the changeDictionarydict I've the folllowing script:


Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
  version    2.0;
  format      ascii;
  class      dictionary;
  object      changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
dictionaryReplacement
{
  boundary
  {
      minY
      {
          type            wall;
      }
 
  }
 
  T
  {
      internalField  uniform 300;
 
      boundaryField
      {
          ".*"
          {
              type            zeroGradient;
              value          uniform 300;
          }
          "heater_to_.*"
          {
 
              type            compressible::turbulentTemperatureCoupledBaffleMixed;
              neighbourFieldName T;
              kappa          solidThermo;
              kappaName      none;
              value          uniform 500;
          }
          minY
          {
              type            zeroGradient;
value          uniform 300;
          }
      }
  }
}
 
// ************************************************************************* //

I've run the case and It doesn't converge. I've waited for 2 hour and I don't get any solution. Is it a problem of the code or do I have to wait longer time?

Thanks you :)

Ahmed Khattab October 25, 2013 12:21

welcome barbara,

Quote:

Originally Posted by Barbara (Post 458975)
Hi Foamers!
I'm new to OpenFoam and I'm working with multiRegionFoam. I've played correctly the tutorial multiRegionHeater but now I'm doing some changes. I'd like to set the T value of the heater to 500 K and delete the condition of the minY which is a fixed temperature. In the changeDictionarydict I've the folllowing script:


Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
  version    2.0;
  format      ascii;
  class      dictionary;
  object      changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
dictionaryReplacement
{
  boundary
  {
      minY
      {
          type            wall;
      }
 
  }
 
  T
  {
      internalField  uniform 300;
 
      boundaryField
      {
          ".*"
          {
              type            zeroGradient;
              value          uniform 300;
          }
          "heater_to_.*"
          {
 
              type            compressible::turbulentTemperatureCoupledBaffleMixed;
              neighbourFieldName T;
              kappa          solidThermo;
              kappaName      none;
              value          uniform 500;
          }
          minY
          {
              type            zeroGradient;
value          uniform 300;
          }
      }
  }
}
 
// ************************************************************************* //

I've run the case and It doesn't converge. I've waited for 2 hour and I don't get any solution. Is it a problem of the code or do I have to wait longer time?

Thanks you :)



actually you didn't delete the condition of minY, i can see it in your file.another thing don't only delete it from your file because ".*" means put this condition for every patch which haven’t another declared BC. so, you must delete ".*" also and put your conditions for all your patches yourself. but notice that if this patch still in your mesh you must put condition for it otherwise OpenFOAM won't run.

Code:

  minY
          {
              type            zeroGradient;
                value          uniform 300;
          }

i can see that you put value for zeroGradient BC and this is wrong you must
change zeroGradient to fixedValue or delete value entry.

i hope this help you.

Barbara October 28, 2013 04:19

Thanks for your answer. I've tried to do what you have told me but it doesn't converge. I've a question, Is the way to fix the temperature correct? Because in the tutorial, the temperature of the heater is variable and I want to fix it.

Thanks you :)

Ahmed Khattab October 28, 2013 14:11

Quote:

Originally Posted by Barbara (Post 459373)
Thanks for your answer. I've tried to do what you have told me but it doesn't converge. I've a question, Is the way to fix the temperature correct? Because in the tutorial, the temperature of the heater is variable and I want to fix it.

Thanks you :)

Hi barbara,

i think temperature is fixed for heater in tutorial case. it differ from patch to other but is fixed for each patch (simulate constant wall temperature).

i hope it helps you.

Ahmed Khattab October 28, 2013 14:12

Hi barbara,

please send me your case files, as attached or URL for dropbox.

thanks

Barbara October 29, 2013 05:52

Hi Ahmed,
Here it's my case files.
https://www.dropbox.com/s/87qse1np1o...mpleHeater.zip

I think in the tutorial the value of T is fixed on the floor (500 K), and the heater changes its T value.

Ahmed Khattab November 5, 2013 05:57

Hi barbara,

sorry to be late. you have mistake in your makeCellSets.setSet in last line
Code:

cellZoneSet Air new setToCellZone bottomAir
you must change bottomAir to Air.

i didn't finished reviewing your case i will feed you back once finished.

good luck.

Ahmed Khattab November 5, 2013 11:13

Quote:

Originally Posted by Barbara (Post 459609)
I think in the tutorial the value of T is fixed on the floor (500 K), and the heater changes its T value.

for the tutorial case the heater haven’t homogeneous temperature. only one patch exposed to higher temperature then it heats up solid heater then air and other solids.

Barbara November 6, 2013 06:17

Hi Ahmed,
I've already found my mistake. I got fix the T value of the heater. I changed the value of the internal field in the changeDictionarydict file. This is my script:

Code:

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

dictionaryReplacement
{
    boundary
    {
        minY
        {
            type            wall;
        }

    }

    T
    {
        internalField  uniform 500;

        boundaryField
        {
            ".*"
            {
                type            fixedValue;
                value          uniform 500;
            }
            "heater_to_.*"
            {
                type            compressible::turbulentTemperatureCoupledBaffleMixed;
                neighbourFieldName T;
                kappa          solidThermo;
                kappaName      none;
                value          uniform 500;
            }

        }
    }
}

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

I've also put a big value of Cp in order to have a fixed value in the heater. Is there any other way to fix this value?

Do you think chtMultiRegionFoam is proper to simulate natural convection?

Thanks :)

Bárbara

Ahmed Khattab November 6, 2013 11:13

Quote:

Originally Posted by Barbara (Post 460820)

Do you think chtMultiRegionFoam is proper to simulate natural convection?

if you want to simulate natural convection, you better use one of boussinesq solvers.


All times are GMT -4. The time now is 22:28.