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

adjust volscalarfield

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 13, 2013, 07:04
Default adjust volscalarfield
  #1
Member
 
v
Join Date: Nov 2011
Posts: 33
Rep Power: 5
vahidzanganeh is on a distinguished road
hi foamers
i will want to constant volscalarfield (Tsol ) in particular time and place. But using the following code does not work properly. and Tsol is not adjust!!
------------------------------------------
for (int i=0;i<U.size();i++)
{
if( runTime.value() > 0.1 && runTime.value() < 0.3 )
if (mesh.C().internalField()[i][0] > 0.031 && mesh.C().internalField()[i][0] < 0.08 && mesh.C().internalField()[i][1] > 0.001 && mesh.C().internalField()[i][1] < 0.009 )
{
Tsol.internalField()[i]=1200.0;
}
}
---------------------
who can help me?
best regards
vahidzanganeh is offline   Reply With Quote

Old   February 13, 2013, 10:06
Default
  #2
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Posts: 124
Rep Power: 8
anishtain4 is on a distinguished road
Where are you adding this code?
Does it change something but that is not what you want? Or there it does not affect your field at all?
there two points in solution, first change the order of for loop and if, so for every grid cell and every iteration it don't check the time. Second I never recommend to use for to loop over OF objects, instead of that try using forAll.
anishtain4 is offline   Reply With Quote

Old   February 13, 2013, 18:31
Default
  #3
Member
 
Join Date: Jun 2012
Posts: 65
Rep Power: 5
conceptone is on a distinguished road
Hi, you can just define a volscalarfield like:
const volscalarfield T
then T would be a constant field,but you need to give the initialised value.
conceptone is offline   Reply With Quote

Old   February 14, 2013, 02:44
Default
  #4
Member
 
v
Join Date: Nov 2011
Posts: 33
Rep Power: 5
vahidzanganeh is on a distinguished road
thanks your reply
i added my reactingFoam.C (in pimple loop)after solved hs and Tsol eqn(Tsol equation is new equation). Tsol is porous medium temperature and Tsol was increased in order to simulation ignition.
--------------------
#include "hsEqn.H"
#include "TsolEqn.H"
if( runTime.value() > 0.1 && runTime.value() < 0.3 )
if (mesh.C().internalField()[i][0] > 0.031 && mesh.C().internalField()[i][0] < 0.08 && mesh.C().internalField()[i][1] > 0.001 && mesh.C().internalField()[i][1] < 0.009 )
{
Tsol.internalField()[i]=1200.0;

}
---------------------------------------------
vahidzanganeh is offline   Reply With Quote

Old   February 15, 2013, 04:34
Default
  #5
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Posts: 124
Rep Power: 8
anishtain4 is on a distinguished road
It seems right but I can understand why you are not getting what you want? Did you see any change after adding this section? Trying increasing it to a dramatic value and see what happens?
also check the limiters you may have been set somewhere else, there is a possibility you've been clipped temperature to a value way below 1200
anishtain4 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to export every data w.r.t time to txt file jaho CFX 94 August 25, 2015 09:45
libOpenSMOKE Tobi OpenFOAM Programming & Development 502 July 23, 2015 21:14
dimensionedScalar + volScalarField is evaluated elementwisely ? tianyikillua OpenFOAM Programming & Development 1 March 30, 2012 03:12
Problems with creating a volScalarField georlade OpenFOAM Programming & Development 2 July 6, 2010 02:19
if-loop, volScalarField comparison volker OpenFOAM 5 April 23, 2010 14:18


All times are GMT -4. The time now is 03:30.