how to output a solved parameter of an equation?
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 |
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 :) |
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> I have also tried unsuccessfully to extract by modifying my controlDict like that: Code:
functions { Regards |
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> I have also tried unsuccessfully to extract by modifying my controlDict like that: Code:
Regards |
I din't know whether you really need each cell. Ususally, I work with sample, which is called afterwards.
|
All times are GMT -4. The time now is 18:04. |