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

How to make a variable as an output

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By hyFoam
  • 1 Post By Santiago

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 19, 2018, 05:06
Default How to make a variable as an output
  #1
New Member
 
Achref Rabhi
Join Date: Sep 2018
Posts: 6
Rep Power: 7
achref_rabhi is on a distinguished road
Hello !

I am currently using reactingTwoPhaseEulerFoam solver to model boiling and I want to make the heat flux variable used in calculation by the solver as an output (in the log file for example). This variable is not initialized by the used and it is created by the solver to calculate other quantities.
Can any one help me how to solve this problem?

Thank you!
achref_rabhi is offline   Reply With Quote

Old   October 19, 2018, 09:14
Default
  #2
Member
 
Vince
Join Date: Mar 2017
Posts: 45
Rep Power: 9
hyFoam is on a distinguished road
Hi,


To print a quantity in the log file, simply introduce the following line

Code:
Info << "my_quantity:" << tab << my_quantity << endl;
where relevant in your code and then re-compile:
Code:
wmake
.


Thanks,
Vincent
achref_rabhi likes this.
hyFoam is offline   Reply With Quote

Old   October 21, 2018, 15:48
Default
  #3
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 15
Santiago is on a distinguished road
Quote:
Originally Posted by achref_rabhi View Post
Hello !

I am currently using reactingTwoPhaseEulerFoam solver to model boiling and I want to make the heat flux variable used in calculation by the solver as an output (in the log file for example). This variable is not initialized by the used and it is created by the solver to calculate other quantities.
Can any one help me how to solve this problem?

Thank you!
One verty easy way is to use the write() method, declared for all geometricFields:

<myField>.write();
achref_rabhi likes this.
Santiago is offline   Reply With Quote

Old   October 23, 2018, 03:43
Default
  #4
New Member
 
Achref Rabhi
Join Date: Sep 2018
Posts: 6
Rep Power: 7
achref_rabhi is on a distinguished road
Thank you every one! this was really helpful!
achref_rabhi 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
[waves2Foam] Waves2Foam Related Topics ngj OpenFOAM Community Contributions 660 August 20, 2018 12:39
Running UDF with Supercomputer roi247 FLUENT 4 October 15, 2015 13:41
In parallel computing, how to make a variable have the same value in all nodes? hotin87 Fluent UDF and Scheme Programming 2 January 23, 2015 12:47
Installation OF1.5-dev ttdtud OpenFOAM Installation 46 May 5, 2009 02:32
Regarding FoamX running Kindly help out hariya03 OpenFOAM Pre-Processing 0 April 18, 2008 04:26


All times are GMT -4. The time now is 07:33.