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

adjust volscalarfield

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 13, 2013, 06:04
Default adjust volscalarfield
  #1
Member
 
v
Join Date: Nov 2011
Posts: 33
Rep Power: 14
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, 09:06
Default
  #2
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
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, 17:31
Default
  #3
Member
 
Join Date: Jun 2012
Posts: 65
Rep Power: 13
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, 01:44
Default
  #4
Member
 
v
Join Date: Nov 2011
Posts: 33
Rep Power: 14
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, 03:34
Default
  #5
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
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 Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 09:21
if-loop, volScalarField comparison volker OpenFOAM 7 March 6, 2020 20:03
Problems with creating a volScalarField georlade OpenFOAM Programming & Development 4 December 4, 2016 12:31
how to export every data w.r.t time to txt file jaho CFX 94 August 25, 2015 09:45
dimensionedScalar + volScalarField is evaluated elementwisely ? tianyikillua OpenFOAM Programming & Development 1 March 30, 2012 03:12


All times are GMT -4. The time now is 06:00.