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

Radiation heat source in chtMultiRegion

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By julieng

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 7, 2021, 06:26
Default Radiation heat source in chtMultiRegion
  #1
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
Hello,

I try to implement a heat source to take into account the external radiation from the ambient temperature on the interface between solid to fluid regions of a very simple test case using chtMultiRegionFoam solver.

My fvOption in the /solid directory is below:

HTML Code:
temperatureLimit
{
    type limitTemperature;
    active true;

    limitTemperatureCoeffs
    {
        selectionMode all;
        min 290;
        max 10000;
    }
}

heatSource
{
    type         scalarCodedSource;

    active       true;
    
    name         sourceTime;

  

    scalarCodedSourceCoeffs
    {
         selectionMode   all;//cellSet
         //cellSet        externalRadiationcell;
        fields        (h);
       // fieldNames (T);
        redirectType sourceTime;
      //   name sourceTime;

        codeInclude
        #{
        
        #};

        codeCorrect
        #{
            Pout<< "**codeCorrect**" << endl;
        #};

        codeAddSup
        #{
        
        
        
            const scalar rhomat = 7850;
            const scalar emi = 0.9;
            const scalar Cp = 450;
            const scalar sigma = 5.670374e-8;
            const scalar Trad = 1000;
           
        
         
            const volScalarField& T = eqn.psi();          // sans cette ligne erreur
            scalarField& hSource = eqn.source();           //defining source
            
          
            
            // Iterating through patch
                word solid_to_fluid = coeffs().lookupOrDefault<word>("patch", "solid_to_fluid");
                const fvPatch& pp = mesh().boundary()[solid_to_fluid];
                forAll(pp, i) {
                label cell_i = pp.faceCells()[i];
               scalar Ai = pp.magSf()[i];
                scalar Ts = T[cell_i];
                hSource[cell_i] = sigma*emi*(pow4(Ts)-pow4(Trad))*Ai/rhomat/Cp;
            }
         
            // Pout << V << endl; // retourne 3200 cells avec un volume de 0.00025 m3 soit 0.8m3 dans log
            // le cellSet comporte 400 cells soit 0.1 m3
            Pout << "***codeAddSup***" << endl;
            Pout << hSource << endl;
           // Pout << pp.magSf() << endl; // retourne la surface d'une cell 0.01m2
         
        #};

        codeSetValue
        #{
         //   Pout<< "**codeSetValue**" << endl;
        #};

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

    sourceTimeCoeffs
    {
         $scalarCodedSourceCoeffs;
    }
}
I have check that the selected cells surfaces where the heatsource term is applied is ok. The dimension of the heatsource is Km^2/s, I don't know if I need to have K/s or something else. I see on the forum that K/s is the correct dimension for volumic heat source.

I think that the problem is the magnitude in pow4(Ts) therm in the heatsource equation.

I have control the Ts value in the log and it seems that it is the h value instead of Temperature value with Ts=h/Cp. In consequense, my heatsource term is too large and the temperature explodes when I run the case.
I have try to put pw4(Ts/Cp) to put a temperature value inside the equation the heatsource term is too low. and the temperature of the surface is not increasing at all.
If I put the line // fieldNames (T); active, an error occurs.

I think that I am not too far the solution but as I don't understand exactly what happened I am not able to write the correct equation.

If someone knows how to resolve this, it would be very helpfull for me.

Best regards

Julien
julieng is offline   Reply With Quote

Old   January 7, 2021, 08:49
Default
  #2
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
Finally it works!!
Simply, I need to put W unit for the heatsource. It matches perfectly with other software.
dlahaye likes this.
julieng is offline   Reply With Quote

Old   January 8, 2021, 14:37
Default
  #3
Senior Member
 
julien
Join Date: Dec 2018
Posts: 107
Rep Power: 7
julieng is on a distinguished road
Hello,

I need to monitor the value of the heatsource term added in the fvOption file.
I can see it in log file but for each cells of the patch. It is quite heavy in the log file and not very usable.
codeAddSup
#{
...
Pout << hSource << endl;
}

Is there a way to create an independant file with my hSourve values via the controlDict file or from the fvOption file ?

Best regards
julieng 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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 07:30
GETVAR Error in Multiband Monte Carlo Radiation Simulation with Directional Source silvan CFX 3 June 16, 2014 09:49
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 05:18
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44


All times are GMT -4. The time now is 04:33.