|
[Sponsors] |
September 14, 2010, 05:34 |
dieselfoam - How to print variables?
|
#1 |
New Member
Join Date: Jun 2010
Posts: 25
Rep Power: 16 |
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 |
|
September 14, 2010, 09:05 |
|
#2 |
Member
edison
Join Date: May 2009
Location: Australia
Posts: 35
Rep Power: 17 |
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.
|
|
September 14, 2010, 10:31 |
|
#3 |
New Member
Join Date: Jun 2010
Posts: 25
Rep Power: 16 |
The problem is there is no createFields.H file for the dieselFoam solver.
|
|
September 14, 2010, 11:30 |
|
#4 |
New Member
Palma González García
Join Date: May 2009
Location: Valencia, Spain
Posts: 8
Rep Power: 17 |
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! |
|
September 16, 2010, 12:55 |
|
#5 |
New Member
Join Date: Jun 2010
Posts: 25
Rep Power: 16 |
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? |
|
September 16, 2010, 14:40 |
|
#6 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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? |
|
September 17, 2010, 03:14 |
|
#7 |
Member
edison
Join Date: May 2009
Location: Australia
Posts: 35
Rep Power: 17 |
you'll have to assign value to the new variable in the solver. Just like what happens to velocity U and pressure p
|
|
September 17, 2010, 05:22 |
|
#8 |
New Member
Join Date: Jun 2010
Posts: 25
Rep Power: 16 |
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? |
|
September 17, 2010, 10:03 |
|
#9 |
Member
edison
Join Date: May 2009
Location: Australia
Posts: 35
Rep Power: 17 |
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. |
|
|
|
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 |