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

Heat source by cell chtMultiRegionSimpleFoam

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

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2019, 10:27
Default
  #21
Member
 
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 39
Rep Power: 2
priyankap is on a distinguished road
Thank you so much for your reply.


I am not using blockMeshDict to generate mesh, instead I am using Salome for that. then how can I define a face now?


Thank you

Last edited by priyankap; April 29, 2019 at 11:38.
priyankap is offline   Reply With Quote

Old   April 29, 2019, 11:37
Default
  #22
Member
 
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 39
Rep Power: 2
priyankap is on a distinguished road
Hi,


How can define my cellSet if I am using ideasUnvToFoam utility to import my mesh from salome to openfoam? because in this case, I can't use topoSetDict to define my regions. Instead, I am using following command for this:


Code:
splitMeshRegions -cellZones -overwrite | tee log.splitMeshRegions
priyankap is offline   Reply With Quote

Old   April 29, 2019, 12:12
Default Internal Energy
  #23
Member
 
Shailesh BG
Join Date: Aug 2017
Location: Bangalore
Posts: 39
Rep Power: 4
shaileshbg is on a distinguished road
Hi,

'h' here is the internal energy/enthalpy [J/Kg] of the system.

To get a better understanding of 'h' and other constants used in the fvOptions framework, I would suggest going through this thread:

Help with the units of enthalpy (h) in chtMultiRegionFoam

In that thread, it is confirmed that the 'h' given in fvOptions does represent power (Watts), so your understanding of putting the power value there is correct. But, there is one more important option to consider, i.e.:

What is the volume mode of your heat source? Here as you can see there are two options:
i) Absolute: It assigns a single emission rate to the whole source, no matter if the source consists of 2 cells or 100 cells. So here the value is given directly as quantity [W].
ii) Specific: Here the value is given as <quantity>/m^3 [W/m^3]

Note: If it is 1000W directly then it is an absolute source.

This and the definitions for every field entry in fvOptions is defined in this blog,

https://caefn.com/openfoam/page/3


Now, for the relationship between enthalpy and the temperature difference, basically

(H2 -H1) = rho*Cp* (T2 -T1) .................................................. ............(i)

where: rho is density
Cp is specific heat at constant pressure

The way it is implemented in the solver is by using thermal diffusivity coefficient;

alpha = kappa/(rho*Cp)


When equation (i) is applied to the case of a simple slab it reduces to the equation which you have given.

So to understand how the temperature is calculated, I would suggest first finding out the value of alpha for your system and then substituting the respective values into equation (i).

To get a perfect understanding of how energy balance and resulting temperature distribution is calculated for each cell, go through your solver's source code, it does take time but it is worth it (and most of the terms are explained in that thread.)


I do not know Salome, so sorry I won't be able to help you with that.
__________________
Regards,
Shailesh
shaileshbg is offline   Reply With Quote

Old   April 29, 2019, 17:57
Default
  #24
Member
 
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 39
Rep Power: 2
priyankap is on a distinguished road
thank you so much for your help. It was really useful.
priyankap is offline   Reply With Quote

Old   May 2, 2019, 12:17
Default
  #25
Member
 
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 39
Rep Power: 2
priyankap is on a distinguished road
Quote:
Originally Posted by shaileshbg View Post
Hi,

You can use the selectionMode option to specify the source region.

Code:
selectionMode   cellSet; // all, cellSet, cellZone, points
But there is no option to set faces or boundary patches. To overcome this, we can use topoSet to select all the faces in the patch (front face) to form a faceSet and then use that faceSet to form a cellSet.

First, define your patch ("front", in this case), easiest is to set it in blockMeshDict.

Then in your topoSetDict, use that patch info to form your faceSet.

Code:
{
        name    frontFaces;
        type    faceSet;
        action  new;
        source  patchToFace;
        sourceInfo
        {
            name "front";
        }
    }
And then use this faceSet to define your cellSet

Code:
// Select based on faceSet

    name    frontFaceCellSet;
    type      cellSet;
    action    new;
    source   faceToCell;
    sourceInfo
   {
       set frontFaces;             // Name of faceSet

       //option neighbour; // cell with neighbour in faceSet
        //option owner;     //  ,,       owner
        option any;         // cell with any face in faceSet
       //option all;       // cell with all faces in faceSet
    }
Use this cellSet in the selectionMode while defining the source.
Code:
selectionMode   cellSet; // all, cellSet, cellZone, points
         cellSet        frontFaceCellSet;
Hope this helps.

Hi Shailesh,

I am using ideasUnvToFoam utility instead of blockMeshDict because I made my geometry in Salome. So I created the patch also in Salome.





After that, I tried using topoSet as per your suggestion. My toposetDict is given below:


Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      topoSetDict;
}

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

actions
(
    // wall
    {
        name    hot;
        type    faceSet;
        action  new;
        source  patchToFace;
        sourceInfo
        {
            name "hotFace";
        }
    }
// Select based on faceSet
    {
        name    hotFaceCellSet;
        type      cellSet;
        action    new;
        source   faceToCell;
        sourceInfo
        {
            set hot;             // Name of faceSet

       //option neighbour; // cell with neighbour in faceSet
            //option owner;     //  ,,       owner
            option any;         // cell with any face in faceSet
            //option all;       // cell with all faces in faceSet
        }
    }
)
Now it is creating the faceSet and cellSet properly. The log file is given below:


Code:
Create time

Create polyMesh for time = 0

Reading topoSetDict

Time = 0
    mesh not changed.
Created faceSet hot
    Applying source patchToFace
    Adding all faces of patch hotFace ...
    Found matching patch hotFace with 1092 faces.
    faceSet hot now size 1092
Created cellSet hotFaceCellSet
    Applying source faceToCell
    Adding cells according to faceSet hot ...
    cellSet hotFaceCellSet now size 1092
End
But I am getting an error. My error is given below:

Code:
Creating finite volume options from "constant/fvOptions"

Selecting finite volume options model type scalarSemiImplicitSource
    Source: heatSource
    - selecting cells using cellSet hotFaceCellSet


--> FOAM FATAL ERROR: 
Illegal content 4105 of set:hotFaceCellSet of type cellSet
Value should be between 0 and 3956

    From function void Foam::topoSet::check(Foam::label)
    in file sets/topoSets/topoSet.C at line 189.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::topoSet::check(int) at ??:?
#3  Foam::cellSet::cellSet(Foam::polyMesh const&, Foam::word  const&, Foam::IOobject::readOption, Foam::IOobject::writeOption) at  ??:?
#4  Foam::fv::cellSetOption::setCellSet() at ??:?
#5  Foam::fv::cellSetOption::cellSetOption(Foam::word const&,  Foam::word const&, Foam::dictionary const&, Foam::fvMesh  const&) at ??:?
#6   Foam::fv::option::adddictionaryConstructorToTable<Foam::fv::SemiImplicitSource<double>  >::New(Foam::word const&, Foam::word const&,  Foam::dictionary const&, Foam::fvMesh const&) at ??:?
#7  Foam::fv::option::New(Foam::word const&, Foam::dictionary const&, Foam::fvMesh const&) at ??:?
#8  Foam::fv::optionList::reset(Foam::dictionary const&) at ??:?
#9  Foam::fv::optionList::optionList(Foam::fvMesh const&, Foam::dictionary const&) at ??:?
#10  Foam::fv::options::options(Foam::fvMesh const&) at ??:?
#11  ? at ??:?
#12  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#13  ? at ??:?
Aborted (core dumped)
Now, I can see that my faceSet and cellSet is created and fvOption is also reading it, But there is some problem with my faceSet (highlighted above).


I don't understand what I did wrong. Can you please guide me if possible?


Thank you
priyankap is offline   Reply With Quote

Old   May 3, 2019, 06:51
Default
  #26
Member
 
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 39
Rep Power: 2
priyankap is on a distinguished road
Hi Shailesh,


I tried making cellSet as you suggested, bu it is giving me errors, and when I tried to view it in paraFoam. It shows the following:


When I create faceSet, it seems to be working, as you can see in the figure below that the red area is the faceSet.


But when I try to make cellSet on the same faceSet, it comes our like some rough shapes on the faceSet.


My topoSetDict file is given below for your reference.



Code:
actions
(
    {
        name    hot1;
        type    faceSet;
        action  new;
        source  patchToFace;
        sourceInfo
        {
            name "hotFace";
        }
    }



//cellSet

    {

        name    hotcell;
        type    cellSet;
        action  new;
        source  faceToCell;
        sourceInfo
        {
            set hot1;      // Name of faceZone, regular expressions allowed
            option  any;      // master/slave
        }
    }

My requirement is to make a cellSet exactly same as faceSet, which means just one suface/face of the box, as you can see in the figure of faceSet below.


I shall be highly thankful if you can help me out in this.
Attached Images
File Type: jpg faceSet.jpg (85.1 KB, 5 views)
File Type: jpg cellSet.jpg (79.5 KB, 4 views)
priyankap is offline   Reply With Quote

Old   May 3, 2019, 10:35
Default Change source info option
  #27
Member
 
Shailesh BG
Join Date: Aug 2017
Location: Bangalore
Posts: 39
Rep Power: 4
shaileshbg is on a distinguished road
Hi,

This is my guess. It may be because the option 'any' is selected in the source info while defining the cellSet.
Code:
option any;         // cell with any face in faceSet
As it says, all cells with any of its face in the faceSet are selected and assigned to the cellSet. This might include faces that are not on the boundary patch, thus explaining the cellSet distribution in your image. This selection might give us some irregular cells selected, thus in fvOptions (where you are telling it to add heat sources to irregular cells), is throwing you an error.

Could you try changing this option to i) owner and ii) all (this might be more accurate as it asks to select only those cells which have all its faces in the faceSet), and see if it correctly selects the cellSet. If paraFoam shows the correct cell distribution then you can add heat sources to it.
__________________
Regards,
Shailesh
shaileshbg is offline   Reply With Quote

Old   May 3, 2019, 12:24
Default
  #28
Member
 
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 39
Rep Power: 2
priyankap is on a distinguished road
Hi,


Thank you for your reply. I already tried these options and even then it is not selecting just the faceSet. When I use i) owner, it remains same as "any" and when I use ii) All, it selects nothing.


I am attaching the dropbox link to my case, I would be grateful if you can please have a look on it.


https://www.dropbox.com/sh/3fy3k575f...MLiNQ-WOa?dl=0


Thank you.
priyankap is offline   Reply With Quote

Old   May 7, 2019, 09:56
Default Working with Structured Mesh
  #29
Member
 
Shailesh BG
Join Date: Aug 2017
Location: Bangalore
Posts: 39
Rep Power: 4
shaileshbg is on a distinguished road
Hi,

Very sorry for such a late reply, I was not in town. Apart from the mesh creation in Salome, the topoSet creation of cellSet and fvOptions definition of the source to that cellSet should be the same.

I do not know Salome, so just to check if the process works I created a simple cube mesh using blockMesh and used the same topoSet to define the cellSet and gave that cellSet scalarSemiImplicitSource. And it works, the option I used in topoSet selection was "any".

I have attached the paraFoam screenshot showing the cube with the lower face acting as the heat source, on the RHS of the screenshot I have shown just the cellSet.

The only difference might be that Salome has created an unstructured mesh, so when you use the option "any", it is selecting interior cells also. You can visualize the cellSet generated in paraFoam, on the left-hand side properties column select the option "Include Sets" under Selection. This should give you the 'cellSet' and the 'faceSet' option under Mesh Parts.

See if the cellSets are selected properly. If the cellSets selected are unruly because of the unstructured mesh, then creating a structured mesh just around your heat source face in Salome would solve your problem.
Attached Images
File Type: png faceSource.png (44.5 KB, 3 views)
__________________
Regards,
Shailesh
shaileshbg is offline   Reply With Quote

Reply

Tags
cell, chtmultiregionsimplefoam, heatsource

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
heat source in one cell only! David UTFSM MEC Fluent UDF and Scheme Programming 1 October 15, 2013 18:14
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 02:41
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 11:57
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 11, 2000 04:43


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