|
[Sponsors] |
Calculate a new filed from variables in the controldict |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 2, 2020, 05:00 |
Calculate a new filed from variables in the controldict
|
#1 |
Senior Member
Carlo_P
Join Date: May 2019
Location: Italy
Posts: 176
Rep Power: 8 |
I would like to calculate the absoulute presssure starting from the cinematic pressure given from a simpleFoam simulation.
I know that it is possible to do in paraview, but how can be done in openFOAM directly? something like #calc pAbs=p*1.2+101.325 How can be written in the controldict as functionObject? |
|
October 2, 2020, 10:17 |
|
#2 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
||
October 2, 2020, 10:51 |
|
#3 | |
Senior Member
Carlo_P
Join Date: May 2019
Location: Italy
Posts: 176
Rep Power: 8 |
For me it is not a version problem, I can use both.
If I understood correctly, I have to put this lines in the controlDict, correclty? Quote:
Then scale 1.2 but for the absolute pressure? (+101325) Should go in the offset? Thanks a lot! |
||
October 2, 2020, 11:28 |
|
#4 | |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Quote:
Code:
where | field values at cell | optional scale factor (default = 1) | current field values at cell at this time | field value at position | offset field value (default = 0) So it should give you something like : Code:
p_Abs { type reference; libs (fieldFunctionObjects); field p; scale 1.2; offset 84437.5; //ie 101325/1.2 } Of course you can add usual parameters for function objects, such as writeControl and writeInterval to control the function execution. Let us know if it does the job for you! Cheers, Yann |
||
Tags |
postprocessing; openfoam; |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to define and calculate LES variables rhoPisoFoam | Jotazeld | OpenFOAM | 1 | April 3, 2020 05:12 |
OpenFOAM - Control and Editing of Lagrangian Output Variables | gmag | OpenFOAM Programming & Development | 1 | June 25, 2019 13:29 |
Sensitivity information for custom design variables | dghate | SU2 | 0 | March 20, 2017 07:39 |
Need of Help: HowTo designate explicitely unknown variables of a question? | Democritus | OpenFOAM Programming & Development | 6 | April 12, 2016 09:38 |
how to calculate the averaged mass flow along a line over time ? | iampolaris | OpenFOAM Post-Processing | 0 | March 10, 2011 23:03 |