CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

writing radiation source term in fireFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 9, 2014, 09:00
Default writing radiation source term in fireFoam
  #1
New Member
 
Join Date: Feb 2012
Posts: 25
Rep Power: 5
Marshak is on a distinguished road
In fireFoam solver, the radiation source term is included in hs equation ..file YhsEqn.H as follows:

fvScalarMatrix hsEqn
(
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
==
DpDt
+ dQ
+ radiation->Shs(thermo)
+ parcels.Sh(hs)
+ surfaceFilm.Sh()
);

I want to write out the radiation source term 'radiation->Shs(thermo)'. Can someone tell what changes should I make in the fireFoam solver to write the radiation source term.
Marshak is offline   Reply With Quote

Old   January 9, 2014, 19:03
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 294
Rep Power: 9
jherb is on a distinguished road
You have to add a new field (probably in createFields.H) which is written every timestep. Then copy radiotion-Shs(thermo) to this field before the timestep is finished.
jherb is offline   Reply With Quote

Old   January 13, 2014, 18:49
Default
  #3
Member
 
赵庆良
Join Date: Aug 2013
Posts: 56
Rep Power: 4
zqlhzx is on a distinguished road
Hi Marshak,
I have the some problem with you!I also want to write out the radiation source term 'radiation->Shs(thermo)'.Have you solved it?If it is solved,could tell how to do it?Thanks in advance!
zqlhzx is offline   Reply With Quote

Old   January 13, 2014, 19:49
Default
  #4
New Member
 
Join Date: Feb 2012
Posts: 25
Rep Power: 5
Marshak is on a distinguished road
'jhreb' I tried with createfields.H but it is not working...
Marshak is offline   Reply With Quote

Old   January 14, 2014, 05:39
Default
  #5
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 294
Rep Power: 9
jherb is on a distinguished road
Here is what I did in a comparable case:
Add a new field to createFields.H
Code:
    volScalarField Shs(
        IOobject
        (
            "Shs",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE // this tells OpenFOAM to store the field after each timestep
        ),
        dimensionedScalar("zero", dimensionSet(0, 0, 1, 0, 0), 0.0) // here you have to set the correct dimensions of your field
    );
Then in YhsEqn.H, either after hsEqn.solve() or thermo.correct() add the following:
Code:
if (pimple.finalIter())
        {
            Shs = radiation->Shs(thermo);
        }
The whole code is not tested. But it should be a starting point.
jherb is offline   Reply With Quote

Old   January 16, 2014, 07:19
Default related question in another thread
  #6
dzi
Member
 
Join Date: Nov 2011
Location: Berlin
Posts: 31
Rep Power: 5
dzi is on a distinguished road
Hello,
fyi I put a related radiation question to another thread
melting problem
thanks dirk
dzi is offline   Reply With Quote

Old   January 16, 2014, 10:51
Default
  #7
New Member
 
Join Date: Feb 2012
Posts: 25
Rep Power: 5
Marshak is on a distinguished road
Shs() in radiation::radiationModel is defined as fvScalarMatrix. How can a fvScalarmatrix be written as a volScalarField?
Marshak is offline   Reply With Quote

Old   January 17, 2014, 12:03
Default
  #8
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 294
Rep Power: 9
jherb is on a distinguished road
You are right. I my case what I really used was something like
Code:
rHS1 = fvc::reconstruct
            (
                (
                  - ghf*fvc::snGrad(rho)
                ) * mesh.magSf()
            );
But here there is a quite simple solution (OpenFOAM version 2.2.2):
Code:
    if (pimple.finalIter())
    {
        Info<< radiation->Sh(thermo);
    }
I guess in your version its ->Shs(thermo). This will output the coefficients of the matrix. If there are only diagonal elements (as it looks like), then you can add ->D() to the command.

I didn't test it, but it is probably possible to assign these diagonal elements to an volume scalar field, which could be written to disk and then loaded into Paraview.

Quote:
Originally Posted by Marshak View Post
Shs() in radiation::radiationModel is defined as fvScalarMatrix. How can a fvScalarmatrix be written as a volScalarField?
jherb is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM Installation for navalFoam sachinlb OpenFOAM Installation 21 June 23, 2014 08:07
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
Problem of SOURCE term gradient in UDS wind Fluent UDF and Scheme Programming 5 June 21, 2013 05:39
funkySetFields compilation error tayo OpenFOAM 39 December 3, 2012 06:18
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24


All times are GMT -4. The time now is 05:07.