CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   to obtain a new variable value in each cell (https://www.cfd-online.com/Forums/openfoam-programming-development/149257-obtain-new-variable-value-each-cell.html)

ARUN K RAJ March 1, 2015 08:03

to obtain a new variable value in each cell
 
Hi Members :)

I want to obtain the mass transfer in each cell of my mesh. I have added the necessary equations. I have included a no_read, auto_write command in createField.H,bt it seems that it writes only a single value for the entire time per run. hw do i calculate the mdot for each cell???? is there any changes to be made in the runtime loop of solver.C file too?
And also is there any way to change volScalarField to dimensionedScalarField?

rapierrz March 1, 2015 09:13

Hi arun. D is a scalar and change in each cell per time


volScalarField D
(
IOobject
(
"D",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("D",dimensionSet(0,2,-1,0,0,0,0), scalar(0.0))
);

ARUN K RAJ March 1, 2015 10:46

Hi Alireza,

I have done a similar thing as you told

-->
volScalarField massflow
(
IOobject
(
"massflow",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("massflow", dimensionSet(1, -1.25, 0.5, 0, 0), scalar(0.0))
);

but the problem is it shows the value zero in the write files in each time intervals :confused:
do we have to change smthng else too. I have seperately named a header file containing masstransfer containing the equation for mass flow. still i get all values as zero


All times are GMT -4. The time now is 07:37.