|
[Sponsors] |
how to output a solved parameter of an equation? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 13, 2018, 13:49 |
how to output a solved parameter of an equation?
|
#1 |
New Member
Katsantonis Michalis
Join Date: Dec 2017
Posts: 21
Rep Power: 9 |
hello everyone,
Let's say i want to write each writeInterval the Nusselt number for every cell (or the average Nu number for the whole domain, even better), which is solved in the heatTransferModels/RanzMarshall/RanzMarshall.C let's say, in the twoPhaseEulerFoam solver. How does somebody do that? Thank you |
|
February 13, 2018, 14:19 |
|
#2 |
Member
Knut Erik T. Giljarhus
Join Date: Mar 2009
Location: Norway
Posts: 35
Rep Power: 22 |
One option is to modify the solver, look in "createFields.H" and add a new volScalarField here for Nu. With the AUTO_WRITE option this will be written when the other fields are written. Then add the code to calculate the Nusselt number at a suitable place in the solver, and recompile the solver. To get the average number you can then use the normal function object functionality to calculate averages.
It's a bit cumbersome, but should teach you a bit about the inner workings of OpenFOAM for further development later |
|
February 14, 2018, 15:17 |
|
#3 |
New Member
Katsantonis Michalis
Join Date: Dec 2017
Posts: 21
Rep Power: 9 |
thanx for the "espresso" reply!
I 've tried your way, but it did not work. What you are saying may seem to work (it's a guess of mine) in cases like the wall heat flux. I'm modeling heat transfer in solid/gas fluidized beds, where the Nusselt number is between particle and gas. The particle Nusselt number is calculated inside the twoPhaseEulerFoam's code and is used in the enthalpy equation, i think. I am giving you the location in the solver: applications/solvers/multiphase/myTwoPhaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C Code:
Foam::tmp<Foam::volScalarField> Foam::heatTransferModels::RanzMarshall::K() const { volScalarField Nu(scalar(2) + 0.6*sqrt(pair_.Re())*cbrt(pair_.Pr())); return 6.0 *max(pair_.dispersed(), residualAlpha_) *pair_.continuous().kappa() *Nu /sqr(pair_.dispersed().d()); } I have also tried unsuccessfully to extract by modifying my controlDict like that: Code:
functions { name4me { type writeRegisteredObject; functionObjectLibs ( "libIOFunctionObjects.so" ); objectNames ("Nu"); outputControl outputTime; outputInterval 1; } } Regards |
|
February 14, 2018, 19:18 |
|
#4 |
New Member
Katsantonis Michalis
Join Date: Dec 2017
Posts: 21
Rep Power: 9 |
thanx for the "espresso" reply!
I 've tried your way, but it did not work. What you are saying may seem to work (it's a guess of mine) in cases like the wall heat flux. I'm modeling heat transfer in solid/gas fluidized beds, where the Nusselt number is between particle and gas. The particle Nusselt number is calculated inside the twoPhaseEulerFoam's code and is used in the enthalpy equation, i think. I am giving you the location in the solver: applications/solvers/multiphase/myTwoPhaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C Code:
Foam::tmp<Foam::volScalarField> Foam::heatTransferModels::RanzMarshall::K() const { volScalarField Nu(scalar(2) + 0.6*sqrt(pair_.Re())*cbrt(pair_.Pr())); return 6.0 *max(pair_.dispersed(), residualAlpha_) *pair_.continuous().kappa() *Nu /sqr(pair_.dispersed().d()); } I have also tried unsuccessfully to extract by modifying my controlDict like that: Code:
functions { name4me { type writeRegisteredObject; functionObjectLibs ( "libIOFunctionObjects.so" ); objectNames ("Nu"); outputControl outputTime; outputInterval 1; } } Regards |
|
February 15, 2018, 01:29 |
|
#5 |
Senior Member
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15 |
I din't know whether you really need each cell. Ususally, I work with sample, which is called afterwards.
__________________
Uwe Pilz -- Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
where can i find "epsilon" or "" parameter in output? | EBehnamtalab | FLOW-3D | 1 | January 11, 2018 14:35 |
How To Get A value in C In An Output Parameter Based On An Expression In CFD-Post | Shomaz ul Haq | CFX | 2 | April 25, 2016 14:17 |
[PyFoam] running pyFoam(Plot)Runner.py in parallel | Studi | OpenFOAM Community Contributions | 10 | September 6, 2015 17:38 |
RNG diverged during the analysis the flow over a multi element airfoil, why? | s.m | OpenFOAM Running, Solving & CFD | 0 | August 5, 2013 09:39 |
error message | cuteapathy | CFX | 14 | March 20, 2012 07:45 |