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

writing radiation source term in fireFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By jherb

Reply
 
LinkBack Thread Tools Search this Thread 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: 14
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: 650
Rep Power: 22
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.
atulkjoy likes this.
jherb is offline   Reply With Quote

Old   January 13, 2014, 18:49
Default
  #3
Member
 
赵庆良
Join Date: Aug 2013
Posts: 56
Rep Power: 13
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: 14
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: 650
Rep Power: 22
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: 15
dzi is on a distinguished road
Hello,
fyi I put a related radiation question to another thread
http://www.cfd-online.com/Forums/ope...blem-5.html#99
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: 14
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: 650
Rep Power: 22
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

Old   March 13, 2018, 07:02
Default
  #9
New Member
 
David Barreiro
Join Date: Jul 2017
Posts: 2
Rep Power: 0
davidbarreiro is on a distinguished road
Hi everyone!

I've got a similar problem with a modification of the kinematicSingleLayer model for reactingParcelFilFoam. I added a pressure term to model the surface tension and it's working quite well. The problem is that I want to visualize this term and I'm not being able to save it. I've tried to modify the original NO_WRITE for AUTO_WRITE but it doesn't work. Any idea??

Code:
tmp<volScalarField> myKinematicSingleLayer::pu()
{
    return tmp<volScalarField>
    (
        new volScalarField 
        (
            IOobject
            (
                typeName + ":pu",
                time_.timeName(),
                regionMesh(),
                IOobject::NO_READ,
                IOobject::AUTO_WRITE
            ),
            pPrimary_                  // pressure (mapped from primary region)
          - pSp_                           // accumulated particle impingement
          - fvc::laplacian(sigma_, delta_) // surface tension
          - sigma_/hDisj_*(cos(theta_/180*3.141593)-1)*exp(-delta_/hDisj_) //Disjoining pressure
        )
    );
}
Thank you in advance,

David
davidbarreiro is offline   Reply With Quote

Old   March 23, 2019, 07:23
Default
  #10
New Member
 
Madeleine Combrinck
Join Date: Jan 2011
Posts: 2
Rep Power: 0
Madeleine C is on a distinguished road
Quote:
Originally Posted by davidbarreiro View Post
Hi everyone!

I've got a similar problem with a modification of the kinematicSingleLayer model for reactingParcelFilFoam. I added a pressure term to model the surface tension and it's working quite well. The problem is that I want to visualize this term and I'm not being able to save it. I've tried to modify the original NO_WRITE for AUTO_WRITE but it doesn't work. Any idea??

Code:
tmp<volScalarField> myKinematicSingleLayer::pu()
{
    return tmp<volScalarField>
    (
        new volScalarField 
        (
            IOobject
            (
                typeName + ":pu",
                time_.timeName(),
                regionMesh(),
                IOobject::NO_READ,
                IOobject::AUTO_WRITE
            ),
            pPrimary_                  // pressure (mapped from primary region)
          - pSp_                           // accumulated particle impingement
          - fvc::laplacian(sigma_, delta_) // surface tension
          - sigma_/hDisj_*(cos(theta_/180*3.141593)-1)*exp(-delta_/hDisj_) //Disjoining pressure
        )
    );
}
Thank you in advance,

David

Dear David,
Did you find a solution to this?
I am attempting to write out a source term and got stuck.
Madeleine C 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
Problem of SOURCE term gradient in UDS wind Fluent UDF and Scheme Programming 6 December 1, 2022 15:21
[Other] OpenFOAM Installation for navalFoam sachinlb OpenFOAM Community Contributions 22 July 28, 2017 06:26
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 02:41
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 06:18
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24


All times are GMT -4. The time now is 10:28.