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

dieselfoam - How to print variables?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 14, 2010, 05:34
Exclamation dieselfoam - How to print variables?
  #1
New Member
 
Join Date: Jun 2010
Posts: 25
Rep Power: 16
mystix is on a distinguished road
Hallo Foamers,

I try to analyze sprays using the dieselfoam-solver.

And I want to print out some variables (Xratio, denominator, Sh, Nu...) over time, but I dont know how.

Can someone help me please?

Thank you in advance!
Markus
mystix is offline   Reply With Quote

Old   September 14, 2010, 09:05
Default
  #2
Member
 
edison
Join Date: May 2009
Location: Australia
Posts: 35
Rep Power: 17
Edison_Ge is on a distinguished road
My way of achieving this would be add the desired field variable in creatField.H and in the solver assign the related valued to the added field variables. Give it a go, but there may be other smarter way of doing it.
Edison_Ge is offline   Reply With Quote

Old   September 14, 2010, 10:31
Default
  #3
New Member
 
Join Date: Jun 2010
Posts: 25
Rep Power: 16
mystix is on a distinguished road
The problem is there is no createFields.H file for the dieselFoam solver.
mystix is offline   Reply With Quote

Old   September 14, 2010, 11:30
Default
  #4
New Member
 
Palma González García
Join Date: May 2009
Location: Valencia, Spain
Posts: 8
Rep Power: 17
Palminchi is on a distinguished road
Yes, there is a createFields.H in dieselFoam. If it is not in the dieselFoam directory, it is located in the dieselEngineFoam one. If you check the options file inside the Make dir, you will see that there is a list of routes which mean that when the solver looks for createFields, if isn't in the solver's dir, it will look for it where options file says. Anyway, you can copy createFields.H to your dieselFoam directory and then add the fields or variables you want to have.

Best regards!
Palminchi is offline   Reply With Quote

Old   September 16, 2010, 12:55
Default
  #5
New Member
 
Join Date: Jun 2010
Posts: 25
Rep Power: 16
mystix is on a distinguished road
Thank you for answers, I copied createFields.H from the dieselEngineFoam to the dieselFoam directory and added the variable Xratio:

volScalarField Xratio
(
IOobject
(
"Xratio",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("Xratio", dimless, 0.0)
);

Now there is a Xratio file in the timestep folder but, the values for Xratio are always 0. That can't be right.

Someone can help me print out the Xratio data please?
mystix is offline   Reply With Quote

Old   September 16, 2010, 14:40
Default
  #6
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
I'm currently trying to to figure this out myself. Here, you've created the field and set it to write on timestep output, but it has been initialized with a value of 0 everywhere, and no indication (here anyway) of where this field is calculated.

This variable isn't built in to dieselFoam, have you implemented it yourself elsewhere?
mturcios777 is offline   Reply With Quote

Old   September 17, 2010, 03:14
Default
  #7
Member
 
edison
Join Date: May 2009
Location: Australia
Posts: 35
Rep Power: 17
Edison_Ge is on a distinguished road
you'll have to assign value to the new variable in the solver. Just like what happens to velocity U and pressure p
Edison_Ge is offline   Reply With Quote

Old   September 17, 2010, 05:22
Default
  #8
New Member
 
Join Date: Jun 2010
Posts: 25
Rep Power: 16
mystix is on a distinguished road
Xratio is declared, initialized and calculated in

../src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C

How can I assign the related valued to the added field variables?
mystix is offline   Reply With Quote

Old   September 17, 2010, 10:03
Default
  #9
Member
 
edison
Join Date: May 2009
Location: Australia
Posts: 35
Rep Power: 17
Edison_Ge is on a distinguished road
hi Markus,
From what I can understand Xratio is a local variable so you can not assin its value to the new field object you've just create. You can try to make it a class member and then give it a return function. Then you can assign the Xratio value to the new field object.
Take Nu for example, there's a return funtion Nu() for Nu. So in the solver you can assign Nu to a new object, simply write
objectX = turbulenc->Nu();
But i'm not that familiar with c++, there may be a easier way.
Edison_Ge 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
injector model in dieselFoam leejc OpenFOAM 8 April 3, 2018 13:30
ADDITIONAL VARIABLES LIMITERS N.P CFX 5 December 1, 2011 08:47
$FOAM_USER_APPBIN & LIBBIN variables not set rassilon OpenFOAM Installation 2 February 16, 2010 21:54
PHI file structure Eugene Phoenics 9 November 2, 2001 23:00
Saving variables on a user patch with physical coordinates Zoltan Turzo CFX 2 April 20, 2000 16:05


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