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

how to output a solved parameter of an equation?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 13, 2018, 13:49
Default how to output a solved parameter of an equation?
  #1
New Member
 
Katsantonis Michalis
Join Date: Dec 2017
Posts: 21
Rep Power: 9
mixkats is on a distinguished road
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
mixkats is offline   Reply With Quote

Old   February 13, 2018, 14:19
Default
  #2
Member
 
Knut Erik T. Giljarhus
Join Date: Mar 2009
Location: Norway
Posts: 35
Rep Power: 22
eric will become famous soon enough
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
eric is offline   Reply With Quote

Old   February 14, 2018, 15:17
Default
  #3
New Member
 
Katsantonis Michalis
Join Date: Dec 2017
Posts: 21
Rep Power: 9
mixkats is on a distinguished road
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());
}
So i need to extract this "Nu", besides the function does not return it (and the "Re" also).

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;     } }
but i can't find why it's not detecting it.

Regards
mixkats is offline   Reply With Quote

Old   February 14, 2018, 19:18
Default
  #4
New Member
 
Katsantonis Michalis
Join Date: Dec 2017
Posts: 21
Rep Power: 9
mixkats is on a distinguished road
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());
}
So i need to extract this "Nu", besides the function does not return it (and the "Re" also).

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;
    }
}
but i can't find why it's not detecting it.

Regards
mixkats is offline   Reply With Quote

Old   February 15, 2018, 01:29
Default
  #5
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
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)
piu58 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
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


All times are GMT -4. The time now is 01:00.