|
[Sponsors] |
How to output specific parameters during the simulation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 29, 2017, 16:50 |
How to output specific parameters during the simulation
|
#1 |
New Member
Lieh
Join Date: Mar 2017
Posts: 26
Rep Power: 9 |
Hello
I am new to openFOAM, I have a question might seem trivial. I want to output the maximum of a certain parameter (say magnitude of velocity in the whole domain) during my simulation for a couple of time steps, I do not know where should I write this couple of code lines? Should it be in a script and run together with the run case? and if so how? Any suggestion codes for doing so is highly appreciated. |
|
March 29, 2017, 17:07 |
|
#2 |
Senior Member
|
Hi,
Is there a reason you do not want to use fieldMinMax function object? You can find example in header file $FOAM_SRC/functionObjects/field/fieldMinMax/fieldMinMax.H |
|
March 29, 2017, 17:15 |
|
#3 |
New Member
Lieh
Join Date: Mar 2017
Posts: 26
Rep Power: 9 |
Thanks so much for your reply. Actually, I looked at this, it's for scalar quantities, not for instance velocity. But also I do not know how to use that function object, shall use it in my control dict, or any other way of using it?
|
|
March 29, 2017, 17:22 |
|
#4 |
Senior Member
|
Why you have decided it is for scalar quantities?
Code:
For variables with a rank greater than zero, either the min/max of a component value or the magnitude is reported. And there is even an example of controlDict in $FOAM_SRC/functionObjects/field/fieldMinMax. |
|
March 30, 2017, 06:38 |
|
#5 |
Member
Ben Jankauskas
Join Date: Jun 2013
Location: Exeter
Posts: 34
Rep Power: 13 |
Hi,
For cases like that I usually just introduce an info statement somewhere in the time loop, such as is done in multiphase solvers. Don't know if you wanted to have the values output into a separate file, if you do, then there must be some sort of function object that would do this sort of thing. If you only wanted to probe the min/max values of the field/parameter, then info statement is good enough and of course if you wanted to see how it evolves over time, then you can always extract them (sed/grep/awk etc.) from the log file to do some post processing. Here's an example from driftFluxFoam alphaEqn.H: Code:
Info<< "Phase-1 volume fraction = " << alpha1.weightedAverage(mesh.Vsc()).value() << " Min(" << alpha1.name() << ") = " << min(alpha1).value() << " Max(" << alpha1.name() << ") = " << max(alpha1).value() << endl; Ben |
|
March 30, 2017, 16:07 |
|
#6 |
New Member
Lieh
Join Date: Mar 2017
Posts: 26
Rep Power: 9 |
Thanks for your reply,
I put the below code in the controlDict but I get the error "keyword field is not defined" Code:
functions { fieldMinMax1 { type fieldMinMax; libs ("libfieldFunctionObjects.so"); ... write yes; log yes; location yes; mode magnitude; fields ( U ); } } |
|
March 30, 2017, 16:30 |
|
#7 |
Senior Member
|
Code:
... |
|
March 30, 2017, 16:38 |
|
#8 |
New Member
Lieh
Join Date: Mar 2017
Posts: 26
Rep Power: 9 |
oops, my mistake, thanks now it is working and printing the maximum and all its relevant info in a separate folder named as "postprocessing".
|
|
Tags |
output data |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pro/E to ANSYS Parameterization Guide | Trues | ANSYS | 4 | April 18, 2018 06:52 |
Simulation of a single bubble with a VOF-method | Suzzn | CFX | 21 | January 29, 2018 01:58 |
Problem with an old Simulation | FrankW | CFX | 3 | February 8, 2016 05:28 |
Unsteady simulation solution files in parallel | gunnersnroses | SU2 | 1 | December 15, 2015 14:28 |
Output Excel File in Transient Simulation | Soon | CFX | 5 | July 11, 2005 07:11 |