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

to obtain a new variable value in each cell

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 1, 2015, 08:03
Default to obtain a new variable value in each cell
  #1
New Member
 
ARUN
Join Date: Jan 2015
Location: Kerala
Posts: 18
Rep Power: 11
ARUN K RAJ is on a distinguished road
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?
ARUN K RAJ is offline   Reply With Quote

Old   March 1, 2015, 09:13
Post
  #2
Senior Member
 
Hesam
Join Date: Feb 2015
Posts: 139
Rep Power: 11
rapierrz is on a distinguished road
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))
);
rapierrz is offline   Reply With Quote

Old   March 1, 2015, 10:46
Unhappy
  #3
New Member
 
ARUN
Join Date: Jan 2015
Location: Kerala
Posts: 18
Rep Power: 11
ARUN K RAJ is on a distinguished road
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
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
ARUN K RAJ 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
Cell Reynolds Number laliong Main CFD Forum 12 September 17, 2019 03:18
I know the cell ID, how do I find the cell coordinates? simpomann OpenFOAM Programming & Development 6 June 30, 2014 10:29
Solution Diverging with Trimmer Mesh rietuk STAR-CCM+ 8 February 27, 2013 04:50
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15
Defining and assigning a variable to a cell Robi FLUENT 0 July 13, 2005 18:27


All times are GMT -4. The time now is 16:04.