CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

How I can introduce my power heat (W) in chtMultiRegionFoam?

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 19, 2015, 12:24
Default
  #21
New Member
 
Lukasz
Join Date: Apr 2012
Posts: 10
Rep Power: 14
loook is on a distinguished road
Hi all,

I had identical problem. The fvOption for solid body does not work in openFoam 2.3.x. I have switched to 2.4 and now everything works fine.

cheers
LK
loook is offline   Reply With Quote

Old   July 11, 2016, 10:53
Default
  #22
Member
 
Bruno
Join Date: Jun 2016
Location: Siegen, Germany
Posts: 59
Rep Power: 10
MBttR is on a distinguished road
Hey aminem (or anyone else! I'm not picky), any chance you're reading this and could reupload your case? I've tried following fvOptions tutorials but they all concern masssources or rotation, I can't seem to find heat source examples.

I'm trying to add a heat source in W to the chtMultiRegionFoam/multiRegionHeater tutorial, but I can't entirely figure out how the fvOptions works. It works fine without fvOptions. It is based on that tutorial, but in stead of the T shaped heater it is just the horizontal part, submerged in air, hence without the two solid regions and the water. I am running OpenFOAM 4.0. I added the following fvOptions file to system/heater (that's where it should be right? not in the main system folder?):

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

heatSource
{
type scalarSemiImplicitSource;
active true;
selectionMode cellZone;
cellZone heater;
scalarSemiImplicitSourceCoeffs
{
	volumeMode absolute;
	injectionRateSuSp
	{
		h (200 0);
	}
}
}



// ************************************************************************* //
Here's the log.chtMultiRegionFoam, with first the important error and then the complete file:

Code:
[3] --> FOAM FATAL IO ERROR: 
[3] keyword selectionMode is undefined in dictionary "IOstream.heatSource.scalarSemiImplicitSourceCoeffs"
Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.0                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 4.0-665f1db4c1f1
Exec   : chtMultiRegionFoam -parallel
Date   : Jul 11 2016
Time   : 15:39:09
Host   : "bruno-VirtualBox"
PID    : 8759
Case   : /home/bruno/OpenFOAM/bruno-4.0/run/chtMultiRegionFoam/multiRegionHeater2
nProcs : 4
Slaves : 
3
(
"bruno-VirtualBox.8760"
"bruno-VirtualBox.8761"
"bruno-VirtualBox.8762"
)

Pstream initialized with:
    floatTransfer      : 0
    nProcsSimpleSum    : 0
    commsType          : nonBlocking
    polling iterations : 0
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create fluid mesh for region topAir for time = 0

Create solid mesh for region heater for time = 0

*** Reading fluid mesh thermophysical properties for region topAir

    Adding to thermoFluid

Selecting thermodynamics package 
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

    Adding to rhoFluid

    Adding to UFluid

    Adding to phiFluid

    Adding to gFluid

    Adding to hRefFluid

    Adding to ghFluid

    Adding to ghfFluid

    Adding to turbulence

Selecting turbulence model type laminar
Selecting radiationModel none
    Adding to KFluid

    Adding to dpdtFluid

    Adding MRF

No MRF models present

    Adding fvOptions

No finite volume options present

*** Reading solid mesh thermophysical properties for region heater

    Adding to thermos

Selecting thermodynamics package 
{
    type            heSolidThermo;
    mixture         pureMixture;
    transport       constIso;
    thermo          hConst;
    equationOfState rhoConst;
    specie          specie;
    energy          sensibleEnthalpy;
}

[3] 
[3] 
[3] --> FOAM FATAL IO ERROR: 
[3] keyword selectionMode is undefined in dictionary "IOstream.heatSource.scalarSemiImplicitSourceCoeffs"
[3] 
[3] file: IOstream.heatSource.scalarSemiImplicitSourceCoeffs from line 0 to line 0.
[3] 
[3]     From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
[3]     in file db/dictionary/dictionary.C at line 441.
[3] 
FOAM parallel run exiting
[3] 
[0] 
[0] 
[0] --> FOAM FATAL IO ERROR: 
[0] keyword selectionMode is undefined in dictionary "/home/bruno/OpenFOAM/bruno-4.0/run/chtMultiRegionFoam/multiRegionHeater2/system/heater/fvOptions.heatSource.scalarSemiImplicitSourceCoeffs"
[0] 
[0] file: /home/bruno/OpenFOAM/bruno-4.0/run/chtMultiRegionFoam/multiRegionHeater2/system/heater/fvOptions.heatSource.scalarSemiImplicitSourceCoeffs from line 25 to line 28.
[0] 
[0]     From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
[0]     in file db/dictionary/dictionary.C at line 441.
[0] 
FOAM parallel run exiting
[0] 
[1] 
[1] 
[1] --> FOAM FATAL IO ERROR: 
[1] keyword selectionMode is undefined in dictionary "IOstream.heatSource.scalarSemiImplicitSourceCoeffs"
[1] 
[1] file: IOstream.heatSource.scalarSemiImplicitSourceCoeffs from line 0 to line 0.
[1] 
[1]     From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
[1]     in file db/dictionary/dictionary.C at line 441.
[1] 
FOAM parallel run exiting
[1] 
[2] 
[2] 
[2] --> FOAM FATAL IO ERROR: 
[2] keyword selectionMode is undefined in dictionary "IOstream.heatSource.scalarSemiImplicitSourceCoeffs"
[2] 
[2] file: IOstream.heatSource.scalarSemiImplicitSourceCoeffs from line 0 to line 0.
[2] 
[2]     From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
[2]     in file db/dictionary/dictionary.C at line 441.
[2] 
FOAM parallel run exiting
[2] 
    Adding to radiations

Selecting radiationModel opaqueSolid
Selecting absorptionEmissionModel constantAbsorptionEmission
Selecting scatterModel none
Selecting sootModel none
    Adding fvOptions

Creating finite volume options from "system/fvOptions"

Selecting finite volume options model type scalarSemiImplicitSource
    Source: heatSource
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD 
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
[bruno-VirtualBox:08757] 3 more processes have sent help message help-mpi-api.txt / mpi-abort
[bruno-VirtualBox:08757] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages
Here's my topoSetDict:

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

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

actions
(
    // Heater
    {
        name    heaterCellSet;
        type    cellSet;
        action  new;
        source  boxToCell;
        sourceInfo
        {
            box (-0.01   0 -0.05 )(0.01 0.01 0.05);
        }
    }
//    {
//        name    heaterCellSet;
//        type    cellSet;
//        action  add;
//        source  boxToCell;
//        sourceInfo
//        {
//            box (-0.01001 -100 -0.01001)(0.01001 0.00999 0.01001);
//        }
//    }
    {
        name    heater;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set heaterCellSet;
        }
    }

    // topAir
    {
        name    topAirCellSet;
        type    cellSet;
        action  new;
        source  cellToCell;
        sourceInfo
        {
            set heaterCellSet;
        }
    }
    {
        name    topAirCellSet;
        type    cellSet;
        action  invert;
    }
    {
        name    topAir;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set topAirCellSet;
        }
    }
);


// ************************************************************************* //
These are the fvScemes and fvSolution for system/heater. I don't think I should indicate here the use of fvOptions, right? As chtMultiRegionFoam reads it, I think this part works.

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

ddtSchemes
{
    default Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;

    div(phi,U)      Gauss upwind;
    div(phi,K)      Gauss linear;
    div(phi,h)      Gauss upwind;
    div(phi,k)      Gauss upwind;
    div(phi,epsilon) Gauss upwind;
    div(phi,R)      Gauss upwind;
    div(R)          Gauss linear;
    div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default        Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

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

solvers
{
    h
    {
        solver           PCG;
        preconditioner   DIC;
        tolerance        1e-06;
        relTol           0.1;
    }

    hFinal
    {
        $h;
        tolerance        1e-06;
        relTol           0;
    }
}

PIMPLE
{
    nNonOrthogonalCorrectors 0;
}

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

*edit*
Read HERE that perhaps the fvOptions file should be moved to the constant folder in stead of system folder since OF3.0, but that doesn't work.
MBttR is offline   Reply With Quote

Old   July 11, 2016, 17:49
Default
  #23
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
Hi, quick answer since I'm on the phone. If you put the fvOptions within the system/heater directory you should define volumeMode to "all" since you are defining the generating region within the region itself and I guess you want all the cells belonging the region to be generating power, right?

You can check out my web site where I discuss and explain similar cases to yours that are very simple. There you can see what I mean.

Hope it helps

Cheers,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   July 12, 2016, 04:45
Default
  #24
Member
 
Bruno
Join Date: Jun 2016
Location: Siegen, Germany
Posts: 59
Rep Power: 10
MBttR is on a distinguished road
Quote:
Originally Posted by zfaraday View Post
Hi, quick answer since I'm on the phone. If you put the fvOptions within the system/heater directory you should define volumeMode to "all" since you are defining the generating region within the region itself and I guess you want all the cells belonging the region to be generating power, right?

You can check out my web site where I discuss and explain similar cases to yours that are very simple. There you can see what I mean.

Hope it helps

Cheers,

Alex
Hey Alex, thanks. Good looking website!

I'm still stuck however. When keeping the fvOptions file in the system/heater folder I have the exact same error (the keyword selectionMode being undefined), even when setting selectionMode to all.

If I put the fvOptions file in the system directory, it seems to get ignored, as all I see in the log is:

Code:
    Adding fvOptions

No finite volume options present
In this case, I have tried both cellZone and cellSet as selectionMode. They both don't work. The code runs, but because of the log entry above I think it is just ignored.

Any clue what might be going wrong_

Cheers!
MBttR is offline   Reply With Quote

Old   July 12, 2016, 06:03
Default
  #25
Member
 
Bruno
Join Date: Jun 2016
Location: Siegen, Germany
Posts: 59
Rep Power: 10
MBttR is on a distinguished road
Update; Just tried the exact same case in OpenFOAM 2.4.0 (instead of OpenFOAM 4.0), here it seems to work.. Guess the way fvOptions works changed? It had nothing to do with running serial or parallel either.

Still interested to dig around in the changelog of OF4.0 though, as I'd rather stay in one OF version for all my cases.

Thanks Alex! Input still welcome.
MBttR is offline   Reply With Quote

Old   July 14, 2016, 12:28
Default
  #26
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 22
zfaraday will become famous soon enough
Hi Bruno,

I just had a very quick glance to the source code of the fvOptions framework for OF 4.x and I think it suffered some little changes in the manner it has to be specified. Check the description in the source code, there you can see that the control parameters now need to be defined within a subdictionary called scalarExplicitSourceCoeffs (you can also see it below)

Code:
        scalarExplicitSourceCoeffs
        {
            timeStart       0.0;        // Start time
            duration        1000.0;     // Duration
            selectionMode   cellSet;    // cellSet, points, cellZone
            .
            .
            .
        }
Try it out and let us know if it works this way!

Cheers,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   July 15, 2016, 06:17
Default
  #27
Senior Member
 
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 172
Rep Power: 13
derekm is on a distinguished road
This change in syntax came in version 3.0
__________________
A CHEERING BAND OF FRIENDLY ELVES CARRY THE CONQUERING ADVENTURER OFF INTO THE SUNSET
derekm is offline   Reply With Quote

Old   July 15, 2016, 08:49
Default
  #28
Member
 
Bruno
Join Date: Jun 2016
Location: Siegen, Germany
Posts: 59
Rep Power: 10
MBttR is on a distinguished road
Thanks Alex and Derek!

Literally just a matter of putting the selectionMode in the Coeffs bracket, hence the correct way for me was (in stead of what you can see a couple posts up from here):

Code:
heatSource
{
     type scalarSemiImplicitSource;
     active true;
     
     scalarSemiImplicitSourceCoeffs
     {
	 volumeMode absolute;
         selectionMode all;
	 injectionRateSuSp
	 {
		h (200 0);
	 }
     }
}
MBttR is offline   Reply With Quote

Old   July 15, 2016, 09:57
Default
  #29
Senior Member
 
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 172
Rep Power: 13
derekm is on a distinguished road
watch out for other changes as well
http://www.cfd-online.com/Forums/ope...ng-v3-0-a.html
MBttR likes this.
__________________
A CHEERING BAND OF FRIENDLY ELVES CARRY THE CONQUERING ADVENTURER OFF INTO THE SUNSET
derekm is offline   Reply With Quote

Old   April 25, 2019, 09:01
Default
  #30
Member
 
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 40
Rep Power: 7
priyankap is on a distinguished road
Hello Derekm,


I have a doubt about this reply of yours:



Quote:
Originally Posted by derekm View Post
Code:
  scalarSemiImplicitSourceCoeffs     {        
 volumeMode    specific;        
 injectionRateSuSp        
 {             h    (10 0);         }     
}
and
Code:
Selecting finite volume options model type scalarSemiImplicitSource
    Source: cylindre_Source_scalar
    - applying source for all time
    - selecting all cells
    - selected 176 cell(s) with volume 2.786796e-06

means 28 microwatts are you expecting to see anything at that power?

to get 1.5W you need a number more like 5E5

How did u know that with 'h (10 0)' and
Code:
 - selected 176 cell(s) with volume 2.786796e-06
mean he has 28 microwatts power.


I mean how can we deduce the power from this line?


Also how can we calculate that, to obtain a power of certain value say 1.5W in this case we need a number like 5E5 or something?



In short, my question is, which is the equation by which we can calculate the value of 'h' that we must put if we need to generate the heat source of some certain power value.
priyankap is offline   Reply With Quote

Old   August 19, 2019, 17:47
Default
  #31
Senior Member
 
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7
Raza Javed is on a distinguished road
Quote:
Originally Posted by zfaraday View Post
Hi Cartuns11,

I'm glad you could make it work in a transient state solver, however, it must work in steady state too because I have been working with chtMultiRegionSimpleFoam with solid generating regions for a while with no problem...

I suggest you something... Why don't you try to run one of the tutorial cases you can find within the "$FOAM_TUTORIALS/heatTransfer/chtMultiRegionSimpleFoam" directory first? You should add a heat source in one of the regions since no one of the tutorials contains volumetric heat generation, but if you are able to make the tutorial run properly obtaining physical results (I'm sure you can do it!) you can then adapt the geometry of your case to the parameters (fvSolution, fvSchemes...) used in the tutorial.

Hope it helps,

Alex
Hello,

I have a question here, I am using fvOption to generate a heat source. The region in which I am putting fvOptions has the dimensions (0.05m x 0.05m x0.05m). its a square block.

And I am putting 5W of power.

I am using specific mode and in fvOptions I am putting value = Power/volume of region.

Now, I want to check that after putting this power, what would be the temperature of my region? But I don't know which mathematical relation to use for that?

When I RUN the solver, the temperature of the region is continuously increasing, and it is not getting stable.

And one more thing I need to ask is that, the power that we put inside the region, is it power dissipation of that object?

I shall be very thankful, if you can help me out in this.

Thank you
Raza Javed is offline   Reply With Quote

Old   August 19, 2019, 18:26
Default
  #32
Senior Member
 
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 172
Rep Power: 13
derekm is on a distinguished road
The value of h in volume mode is watts per cubic metre

Quote:
Originally Posted by priyankap View Post
Hello Derekm,


I have a doubt about this reply of yours:






How did u know that with 'h (10 0)' and
Code:
 - selected 176 cell(s) with volume 2.786796e-06
mean he has 28 microwatts power.


I mean how can we deduce the power from this line?


Also how can we calculate that, to obtain a power of certain value say 1.5W in this case we need a number like 5E5 or something?



In short, my question is, which is the equation by which we can calculate the value of 'h' that we must put if we need to generate the heat source of some certain power value.
__________________
A CHEERING BAND OF FRIENDLY ELVES CARRY THE CONQUERING ADVENTURER OFF INTO THE SUNSET
derekm is offline   Reply With Quote

Old   August 29, 2019, 03:23
Default
  #33
Member
 
Vishnu
Join Date: May 2019
Location: Tamilnadu, India
Posts: 55
Rep Power: 7
Vishsel is on a distinguished road
Hi FOAMers,

May i know fvSolution and fvSchemes file for porous media with heat source at surface of the wall ??
Vishsel 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
chtMultiRegionFoam connection between solid and fluid region of heat exchanger ahab OpenFOAM 1 December 18, 2019 01:37
dieselFoam problem!! trying to introduce a new heat transfer model vivek070176 OpenFOAM Programming & Development 10 December 24, 2014 00:48
Constant velocity of the material Sas CFX 15 July 13, 2010 09:56
Problem of heat balance in Coal Boiler simulation DG FLUENT 9 December 25, 2008 21:57
Concentric tube heat exchanger (Air-Water) Young CFX 5 October 7, 2008 00:17


All times are GMT -4. The time now is 02:30.