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

Distributed Heat Source - fvOptions (chtMultiRegionFoam)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2021, 11:19
Default Distributed Heat Source - fvOptions (chtMultiRegionFoam)
  #1
New Member
 
Ste07's Avatar
 
Stefano Riva
Join Date: Dec 2020
Location: Milano
Posts: 4
Rep Power: 3
Ste07 is on a distinguished road
Good morning,
I'm pretty new to the OpenFOAM stuff and I'm currently facing the following problem. I would like to solve a multi-region problem (solver: chtMultiRegionFoam) with solid and fluid, some of the solid regions should produce power (different per each region). This has been set with the following fvOptions file
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

heat_dwn
{
    type          scalarCodedSource;

    active          true;
    
    name    sourceTime;

  

    scalarCodedSourceCoeffs
    {
         selectionMode   cellZone;
         cellZone        heat_dwn;
	     fields      (h);

        codeInclude
        #{

        #};

        codeCorrect
        #{
        #};

        codeAddSup
        #{
	     const Time& time = mesh().time();
                const scalarField& V = mesh_.V();
                scalarField& heSource = eqn.source();

                const labelList& cellIDs = cells();

                forAll(cellIDs, i)
                {
                    label cellI = cellIDs[i];
                    heSource[cellI] = -1305525.64*V[cellI]; // net power 1 kW
                }
        #};

        codeSetValue
        #{
        #};

        // Dummy entry. Make dependent on above to trigger recompilation
        code
        #{
            $codeInclude
            $codeCorrect
            $codeAddSup
            $codeSetValue
        #};
    }

    sourceTimeCoeffs
    {
         $scalarCodedSourceCoeffs;
    }
}




// ************************************************************************* //
The names of the heat regions are heat_dwn, heat_dx and heat_sx and the power they should produce is not the same. I write 3 fvOptions file (one per each region) with the specified value, but when running the case the solver uses only the input from heat_dwn (which is the one read first) ignoring the others.
For instance the previous value of 1305525.64, will be set per each region.

Has anyone ever faced this kind of issue?

Thanks in advance
Regards
Ste07 is offline   Reply With Quote

Reply

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
Adding heat source to chtMultiRegionFoam maddalena OpenFOAM Programming & Development 61 February 17, 2018 09:33
Specification of Gaussian distributed heat source? mich_K FLUENT 5 December 30, 2014 09:14
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 13:41
[swak4Foam] swak4Foam-groovyBC build problem zxj160 OpenFOAM Community Contributions 18 July 30, 2013 14:14
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 06:18


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