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

dieselfoam - How to print variables?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 14, 2010, 04:34
Exclamation dieselfoam - How to print variables?
  #1
New Member
 
Join Date: Jun 2010
Posts: 25
Rep Power: 7
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, 08:05
Default
  #2
Member
 
edison
Join Date: May 2009
Location: Australia
Posts: 33
Rep Power: 8
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, 09:31
Default
  #3
New Member
 
Join Date: Jun 2010
Posts: 25
Rep Power: 7
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, 10:30
Default
  #4
New Member
 
Palma González García
Join Date: May 2009
Location: Valencia, Spain
Posts: 8
Rep Power: 8
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, 11:55
Default
  #5
New Member
 
Join Date: Jun 2010
Posts: 25
Rep Power: 7
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, 13:40
Default
  #6
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
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, 02:14
Default
  #7
Member
 
edison
Join Date: May 2009
Location: Australia
Posts: 33
Rep Power: 8
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, 04:22
Default
  #8
New Member
 
Join Date: Jun 2010
Posts: 25
Rep Power: 7
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, 09:03
Default
  #9
Member
 
edison
Join Date: May 2009
Location: Australia
Posts: 33
Rep Power: 8
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
injector model in dieselFoam leejc OpenFOAM 7 June 1, 2014 05:13
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 15:05


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