Adding heat sources in hvac simulations

Hi all,

While running hvac simulations is it possible to add heat sources? To keep things simple I can uniformly distribute people and lighting load over the floor area.
Or should I make a box and assign certain surface temperature according to the heat load I am expecting?

Any help is much appreciated.

Thank you!

1 Like

Hi @SaketSarupria

Currently there is no automated way to do this with BF but we should be able to add this one soon.

I’ll try and explain below a simple, manual way that you can do this in your model. The steps are quite simple:

  1. Create the solid surface in which you wish to apply the heat source. Identify the W/m3 of the heat source that you want to apply according to the volume of the surface.
  2. Export the surface as an .stl file from Rhino and save it in the constant/triSurface folder of your case
  3. Create a file called topoSetDict in your /system folder containing the following:

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

actions
(
{
name test;
type faceZoneSet;
action new;
source searchableSurfaceToFaceZone;
sourceInfo
{
surface triSurfaceMesh;
name “test.stl”
useSurfaceOrientation true;
outsidePoints ((-99 -99 15)); // here simply put a point coordinate OUTSIDE the solid surface
includeCut false;
includeInside true; // here we tell topoSet to select cells inside the area of itnerest
includeOutside false; //we don’t want to select anything outside
nearDistance -1;
curvature 0.9; // cells within nearDistance
}
}

{
    name test;   //this might not be required, put it here for completeness, the sourceInfo is used I believe
    type cellSet;
    action new;
    source faceZoneToCell;
    sourceInfo
    {
            name test; //name this whatever you want
            option master;
    }
});
  1. Go to the OF terminal, navigate to your case (by typing: cd workingDir/butterfly/yourCaseFolderNameHere) and type: topoSet. Press enter. This creates your cellSet.
  2. Create a file named fvOptions in the system folder of your case containing the following:

/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 2.3.0 |
| \ / A nd | Web: www.OpenFOAM.org |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location “system”;
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
heatSource
{
type scalarSemiImplicitSource;
active true;
selectionMode cellSet;

scalarSemiImplicitSourceCoeffs
{
cellSet test; //this has to be the name of the cellSet you used.
selectionMode cellSet;
volumeMode absolute; //absolute means we are giving it a value not a ratio
injectionRateSuSp
{
T (238.81 0); //The heat source value is calculated as Q / (rho * cp) , where Q is the W/m3,
//rho is density, cp specific heat, in this case I used 300 Watts, 1.25 rho, 1.005 cp
}
}
}

  1. Run your case.

Hope this helps! Let us know.

Kind regards,
Theodore.

4 Likes

Many thanks @TheodorosGalanos for the detailed step by step instructions. I will try in some time today and get back to you with the results.

@TheodorosGalanos Your workflow is so detailed. And is there any possibility to make this function as a new grasshooper component?

Hi Theodore,

Thanks again for the help.
I think I was able to run the simulation in the end. Had to do a few changes - change file name to topoSetDict.
Change the header to -

FoamFile
{
version 4.0;
format ascii;
class dictionary;
location “system”;
object fvOptions; // or topoSetDict
}

Run topoSet after snappyHexMesh? In my trials if I ran topoSet in the beginning followed by blkmesh and shm, the sets folder would be erased. Not sure what’s the exact workflow, I was trying different combinations.

In the default hvac example file I added a box of height 0.1m on the floor.


Am I suppose to calculate heat load for the whole room and pack all that heat in the small box on the floor? (75W/person, 3m2 per person, 6W/m2 Lighting load. 15m2 area of room and 2.5m height). If I pack all the room’s heat gain in the small box, it comes out to be about 310W. Running the case with that value shoots up the overall T in the room to 450K (gif of 600 time steps below). Am I supposed to take the W/m3 and multiply it with the volume of the 0.1m box? The inlet is set to default values, 23°C air flowing at 0.1 m3/s.

.test

Pls help where I might be going wrong. Also how many time steps I should run to get near convergence? 2000+?

Thank you very much for the help and suggestions.

Regards
Saket

1 Like

Ah yes sorry about that, it’s ofc a dictionary so topoSetDict.

You would run it after the mesh has been completed since it needs to capture the mesh cells within the region you are selecting.

As for the calculations, you need to give it a W/m3 value if you have it as absolute.

If you calculate the loads for the whole room and distribute them all over the space, then for the values of your example you have about 31W/m2 (adding lights and people). Since it’s a 2.5m high area you have about 12.4W/m3 (31/3). In that case you value in the fvOptions would be: 12.4 / (1.25 + 1.005) = 5.5

I wouldn’t put all that in the first 0.1m cause that’s not realistic. You can add the people loads in the first 2m perhaps but the zone is small enough to simply distribute everything along the space.

Hope this helps.

Kind regards,
Theodore.

Hi @minggangyin Indeed there is. We plan to do this very soon.

2 Likes

Many thanks @TheodorosGalanos. Should work perfectly now.
Is it possible to add multiple heat sources with different heat gain values as well with this method?

Thanks a lot. You guys are awesome!!

Hi @SaketSarupria this is a volumetric heat source so you can add as many as the volumes you are inputing in the topoSetDict.

If you want to create a lot of point sources of heat I would rather suggest simply modeling the geometry in mind with a surface temperature indicative of the heat source. Much like the hot room tutorial.

Kind regards,
Theodore.

Hi @TheodorosGalanos
I was trying to integrate multiple heat sources (2 only at the moment). topoSet creates two files as expected.

actions
(
{
name test_1;
type faceZoneSet;
action new;
source searchableSurfaceToFaceZone;
sourceInfo
{
surface triSurfaceMesh;
name “test_1.stl”
useSurfaceOrientation true;
outsidePoints ((5 17 1));
includeCut false;
includeInside true;
includeOutside false;
nearDistance -1;
curvature 0.9;
}
}
{
name test_2;
type faceZoneSet;
action new;
source searchableSurfaceToFaceZone;
sourceInfo
{
surface triSurfaceMesh;
name “test_2.stl”
useSurfaceOrientation true;
outsidePoints ((5 17 1));
includeCut false;
includeInside true;
includeOutside false;
nearDistance -1;
curvature 0.9;
}
}
);

But I am struggling with fvOptions. I am certain there is something wrong in my syntax.

heatSource
{
type scalarSemiImplicitSource;
active true;
selectionMode cellSet;
scalarSemiImplicitSourceCoeffs
{
cellSet test_1;
selectionMode cellSet;
volumeMode absolute;
injectionRateSuSp
{
T (4.5 0);
}

cellSet test_2;
selectionMode cellSet;
volumeMode absolute;
injectionRateSuSp
{
T (2.5 0);
}
}
}

I tried playing with the brackets and some other options. Either only the second heat source is getting detected or none of them.

Can you pls give your input on this.

Thank you very much.

Regards
Saket

Hi @SaketSarupria

It’s actually the same idea as your topoSet. Your heatSource in the fvOptions is actually the name of your first heat source. You can name it what you want and you can add more blocks like that one as heat sources.

Kind regards,
Theodore.

I had to rename the heatsources in fvOptions as heatsource1 , heatsource2, etc. Works perfectly now.

Thank you very much for the help. Much appreciated.

Regards
Saket

At the moment the cells representing the heat source show constant temperature which looks a bit strange visually.


@TheodorosGalanos Can you provide some input on how to integrate heat sources as W/m2 on a surface.
One way I can think of is to find surface temperature of the floor corresponding to the heat load.

Thank you very much for helping out.

Just to update, I ran a bunch of hand calcs to verify the mass flow balance. To conclude, in fvOptions the Q is actually in kW and not W/m3.
I ran a test model with 2kW heat load and expected a temp at outlet of 20.5°C. The resulting avg. temp was 20.56°C.

1 Like

@SaketSarupria I am pretty sure the manual indicates W or W/m3 if the mode is set as specific.

I think what we I did not mention clearly above was the mode to use. We added a W/m3 heat source with an absolute volumeMode. That should be changed to specific, which sets those values for each cubic meter of the space, and run again. Let me know if that works.

Kind regards,
Theodore.

hi all
Thanks for the detailed step by step instructions. I have tried this in my indoor nature ventilation simulation model.I put a person in the room and then follow the steps above, but i didn’t get the result.There must be something wrong that I didn’t know.

!

the topoSetDict containing the following:

/--------------------------------- C++ -----------------------------------\

| ========= |
|| \ / F ield | OpenFOAM: The Open Source CFD Toolbox
|| \ / O peration | Version: v1612+
|| \ / A nd | Web: www.OpenFOAM.org
|| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 4.0;
format ascii;
class dictionary;
location “system”;
object topoSetDict;
}
actions
(
{
name heatsourse1;
type faceZoneSet;
action new;
source searchableSurfaceToFaceZone;
sourceInfo
{
surface triSurfaceMesh;
name “heatsourse1.stl”
useSurfaceOrientation true;
outsidePoints ((4 -30 1));
includeCut false;
includeInside true;
includeOutside false;
nearDistance -1;
curvature 0.9;
}
}
{
name heatsourse1;
type cellSet;
action new;
source faceZoneToCell;
sourceInfo
{
name heatsourse1;
option master;
}
});

the fvOptions containing the following:

/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: v1612+ |
| \ / A nd | Web: www.OpenFOAM.org |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/

FoamFile
{
version 4.0;
format ascii;
class dictionary;
location “system”;

object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
heatSource
{
type scalarSemiImplicitSource;
active true;
selectionMode cellSet;
scalarSemiImplicitSourceCoeffs
{
cellSet heatsourse1;
selectionMode cellSet;
volumeMode absolute;
injectionRateSuSp
{
T (200 0);
}
}
}

hi @TheodorosGalanos and @SaketSarupria

I am running on openfoam6.

for :
heat
{
type scalarSemiImplicitSource;
active true;

scalarSemiImplicitSourceCoeffs
{
	cellSet heat; //this has to be the name of the cellSet you used.
	selectionMode cellSet;
	volumeMode	specific; //absolute means we are giving it a value not a ratio
	injectionRateSuSp
	{
		T 	(5 0); //The heat source value is calculated as Q / (rho * cp) , where Q is the W/m3,
						//rho is density, cp specific heat, in this case I used 300 Watts, 1.25 rho, 1.005 cp
	}
}

}

using T is returns:

–> FOAM Warning :
From function virtual void Foam::fv::option::checkApplied() const
in file cfdTools/general/fvOptions/fvOption.C at line 125
Source sprinklers defined for field T but never used

As I am using buoyantSimpleFoam instead of buoyantBoussinesqSimpleFoam, it works using enthalpy h though I remain confused about how to set it and if its specific or absolute.

Would you have any idea how to deal with h?

2 Likes

@WuXue I believe you haven’t actually created your cellset (i.e. the part of the room that should have these thermal properties), the second box tells you that.

@OlivierDambron Were the sprinklers a cellzone for you? The error is telling us that it was defined but not used, interesting that would pop up an error though.

hi @TheodorosGalanos

I’ve created a simple example just for testing.

Regardless of setting h correctly, the first issue I encounter is in fact that the cells emiting a heat flux seem to be ones located on the surface of the stl and not all the cells within that stl/region/zone/set.

FvOptions and topoSetDict were set as follows.

fvOptions:
heat
{
type scalarSemiImplicitSource;
active true;
scalarSemiImplicitSourceCoeffs
{
cellSet heat; //this has to be the name of the cellSet you used.
selectionMode cellSet;
volumeMode specific; //absolute means we are giving it a value not a ratio
injectionRateSuSp
{
h (7.5 0);
}
}
}

topoSetDict:
actions
(
{
name heat;
type faceZoneSet;
action new;
source searchableSurfaceToFaceZone;
sourceInfo
{
surface triSurfaceMesh;
name “heat.stl”
useSurfaceOrientation true;
outsidePoints ((1.9965 1.10433 8.35321));
includeCut false;
includeInside true;
includeOutside false;
nearDistance -1;
curvature 0.9;
}
}
);


I’ve tried in vain to tweak these two settings to make all the cells in that stl generate a heatflux. Would you know how ?

Thanks in advance,
Olivier