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

Using incident radiation (G) in the solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2011, 08:56
Lightbulb Using incident radiation (G) in the solver
  #1
New Member
 
Mostafa Moghaddami
Join Date: Oct 2009
Posts: 13
Rep Power: 16
Mostafa is on a distinguished road
Dear all,


I have some problems while generating a new solver base on the icoFOAM in OpenFOAM 1.7.0.
At first, I have added the radiation model and two species transport equations (YH2O2 and YOHr) to the icoFOAM. Up to this step the solver worked correctly and provided reasonable results. Then I wanted to use incident radiation (G or G_) as a part of the source term of the species transport equations. But I got this error:


Quote:
In file included from WUVrad.C:118:
chemicalComponents.H: In function ‘int main(int, char**)’:
chemicalComponents.H:7: error: ‘G’ was not declared in this scope
It seems that the G (incident radiation) is a private scalerfield in the radiation models.
I wonder if there is anyway to use the incident radiation (G) as a parameter in my solver?


The files of the solver are attached.


Any help would be appreciated.


Regards
Mostafa
Attached Files
File Type: zip WUVrad.zip (8.2 KB, 22 views)
Mostafa is offline   Reply With Quote

Old   May 1, 2018, 04:51
Default
  #2
Member
 
chengan.wang
Join Date: Jan 2016
Location: china
Posts: 47
Rep Power: 10
wangchengan2003 is on a distinguished road
Send a message via Skype™ to wangchengan2003
Dear Mostaf,
I meet samiliar problem like you. I want to use incident radiaton in my solver. But it is private scalarfield. Have you solved your problem?
Chengan
wangchengan2003 is offline   Reply With Quote

Old   May 2, 2018, 08:10
Default
  #3
Member
 
chengan.wang
Join Date: Jan 2016
Location: china
Posts: 47
Rep Power: 10
wangchengan2003 is on a distinguished road
Send a message via Skype™ to wangchengan2003
Hello everyone,

I want to use incident radiation 'G' in my solver, which is in the attachement.

In c++ code, it writes

Code:
class fvDOM
:
    public radiationModel
{
    // Private data


        //- Incident radiation  [W/m2]
        volScalarField G_;
Code:
            //- Const access to incident radiation field
            inline const volScalarField& G() const;
It seems that incident radition 'G' is private scalar field. If somebody could give me some suggestiong?

Best regards

Chengan
Attached Files
File Type: h fvDOM.H (7.9 KB, 6 views)
wangchengan2003 is offline   Reply With Quote

Old   May 21, 2019, 04:44
Default
  #4
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
Maybe the reply is a bit late but one can access a field present in memory by the following command:

const volScalarField& G_ = U.mesh().lookupObject<volScalarField>("G");

it gives you constant access to the desired field (obviously it cannot be modified)

Best

Michael
mAlletto is offline   Reply With Quote

Old   May 26, 2019, 20:51
Default
  #5
Member
 
chengan.wang
Join Date: Jan 2016
Location: china
Posts: 47
Rep Power: 10
wangchengan2003 is on a distinguished road
Send a message via Skype™ to wangchengan2003
Hello Michael,


Thank you for your reply.


Best regards


Chengan
wangchengan2003 is offline   Reply With Quote

Reply

Tags
incident radiation, modeling


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
Creating New Solver: For particle-laden compressible jets sankarv OpenFOAM Running, Solving & CFD 17 December 3, 2014 19:41
Quarter Burner mesh with periosic condition SamCanuck FLUENT 2 August 31, 2011 11:34
Creating New Solver: For particle-laden compressible jets sankarv OpenFOAM 0 April 4, 2010 18:06
Question about radiation Flying CFX 0 January 12, 2005 20:32
radiation source-modeling people in room? CFX5.7User CFX 0 November 10, 2004 14:32


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