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

create fields for arguments that are created in the middle of a calculation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2023, 20:42
Default create fields for arguments that are created in the middle of a calculation
  #1
New Member
 
Sangmin Kim
Join Date: Aug 2019
Posts: 6
Rep Power: 7
sm0226 is on a distinguished road
Hello.

I am currently conducting a combustion analysis using OF-v2112.
In the code below, specifically in inhomogeneousMixture.C, 'ox' (oxidant mass fraction) is being calculated.
I would like to generate this as a single field.

I need your advice.
Thank you.




// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

template<class ThermoType>
const ThermoType& Foam::inhomogeneousMixture<ThermoType>::mixture
(
const scalar ft,
const scalar b
) const
{
if (ft < 0.0001)
{
return oxidant_;
}
else
{
scalar fu = b*ft + (1.0 - b)*fres(ft, stoicRatio().value());
scalar ox = 1 - ft - (ft - fu)*stoicRatio().value();
scalar pr = 1 - fu - ox;

mixture_ = fu*fuel_;
mixture_ += ox*oxidant_;
mixture_ += pr*products_;

return mixture_;
}
}
sm0226 is offline   Reply With Quote

Old   March 24, 2023, 10:04
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello,

I have absolutely no experience with your solver, but if the variable is registered in the database you can try to use the writeObjects function:
https://develop.openfoam.com/Develop...writeObjects.H

I hope this helps,
Yann
Yann 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
Meshing a Sphere Ajay FLUENT 10 September 3, 2016 15:18
PostChannel maka OpenFOAM Post-Processing 5 July 22, 2009 10:15
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
How to create a vector field out of scalar fields anja OpenFOAM Pre-Processing 7 May 31, 2006 12:56
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


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