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

How to assign value in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   December 19, 2019, 22:23
Default How to assign value in OpenFOAM
  #1
Senior Member
 
Nguyen Duy Trong
Join Date: Apr 2014
Posts: 124
Rep Power: 12
ndtrong is on a distinguished road
Hi everyone,

I have a problem related to assign value in OpenFOAM, the detail is as follow:

in interFoam solver, two variable alpha1 and alpha2 are defined as:
volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2());


Now, I declare a variable with same type as:

volScalarField H
(
IOobject
(
"H",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
alpha1
);

to compute something.
After computation, I want to reassign value of alpha1 by H as:
alpha1 = H;
However, my assignment did not work since when I check the printed output of two files alpha1 and H, the value in same cell mesh are not identical as shown in the attachement.

Could anyone help me to explain the reason for that.

I thank you very much in advance.
Attached Images
File Type: png compare_2files.png (82.7 KB, 22 views)
ndtrong is offline   Reply With Quote

 


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
OpenFOAM 5.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 11 June 5, 2018 23:48
OpenFOAM Training Jan-Jul 2017, Virtual, London, Houston, Berlin CFDFoundation OpenFOAM Announcements from Other Sources 0 January 4, 2017 06:15
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 13:36
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 05:36
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 14:25


All times are GMT -4. The time now is 11:35.