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

How to extract scalar members from a class ?

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 24, 2020, 06:42
Question How to extract scalar members from a class ?
  #1
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hello Foamers,
I'm currently working on a custom solver and there is something I can't figure out. The solver calculates thermal conductivity (K) based on various scalar variables (pi, pR, pT, px) as shown below.
Quote:
template<class thermo>
inline Foam::scalar Foam::conductivitySolidTransport<thermo>::K //thermal conductivity
(
const scalar T
) const
{
return
((1-pR)*(0.012848335*pow(T,0.5))) + (pT*(0.000496*T)) + (pi*(0.0000000000342*pow(T,3))) + (px*(0.00000000228*pow(T,3)));
}
Since, the thermal conductivity (K) is a field variable (volScalarField), the variable gets extracted and printed in every time folder while simulation runs and could able to plot easily in the post-processing. However, the scalar variables (pi, pR, pT, px) mentioned above are not extracted, since its not a field variable.
How to extract such scalar variables (pi, pR, pT, px) in OpenFOAM ?
My idea was to use an IOobject to write this variable in each time directory, but I can't figure out how.
Kindly someone suggest me some ideas or references.
Thank You

Last edited by Kummi; August 25, 2020 at 10:41.
Kummi is offline   Reply With Quote

 


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
Error in New Surface reaction model (Having multiple reactions) surajkvs OpenFOAM Programming & Development 2 May 23, 2023 21:21
Extract a member function from a class of different solver for "Source Term" Kummi OpenFOAM 7 December 26, 2019 22:32
FATAL ERROR:Maximum number of iterations exceeded zqlhzx OpenFOAM Running, Solving & CFD 4 July 13, 2016 15:53
dimensionedScalar as class member Seeker OpenFOAM Programming & Development 2 March 29, 2013 05:57
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 01:27


All times are GMT -4. The time now is 11:12.