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

declaration of an empty fvScalarMatrix

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 11, 2011, 11:32
Default declaration of an empty fvScalarMatrix
  #1
Senior Member
 
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 17
linch is on a distinguished road
Hi fellows,

I want to underrelax some equation, so I have to declare fvScalarMatrix someEqn outside of my loop to prevent it from being deleted after each loop cycle right? But I can't use rubbish for initialization, because then it will be used for under-relaxation. So I need some kind of "empty" matrix, which will not be used for the relaxation. Is it possible? If not, can I prevent the under-relaxation in the first iteration?

best regards,
Ilya
linch is offline   Reply With Quote

Old   November 14, 2011, 07:28
Default
  #2
Senior Member
 
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 16
stevenvanharen is on a distinguished road
Under-relaxation is already implemented in OpenFOAM.

See for instance pisoFOAM.

The amount of under-relaxtion can be controlled in fvSolution. Look for relaxtionFactors specified in fvSolution of some of the tutorials.
stevenvanharen is offline   Reply With Quote

Old   November 17, 2011, 08:09
Default
  #3
Senior Member
 
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 17
linch is on a distinguished road
Well, I know that the under-relaxation is already there, but my problem is that i have two loops, say i and j (j is the inner one) and I want to relax a matrix A in each j-iteration with the same value from the last i-iteration. Simplified:
Code:
for (i=0; i<n; i++)
{
  for (j=0; j>m;j++)
  {
    A_new=...;
    A_new=fRel*A_new + (1-fRel)*A_old;  // relaxation
  }
  A_old=A_new;
}
in other words, I want to update A_old in each outer but not in inner iteration. And relaxation implemented in OF takes the last available value of A_new, no matter where does it come from, right?

So either I could implement the relaxation by hand, or I could overwrite the previous value of A_new (how?) with A_old stored separately.

Which variant would you suggest me? Or do somebody have another ideas?

regards,
ilya
linch is offline   Reply With Quote

Old   November 22, 2011, 10:11
Default
  #4
Senior Member
 
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 17
linch is on a distinguished road
another question,

for a transient simulation, is F.oldTime() the same as F.prevIter(), where F is some vol...Field?

Are both of these fields stored? If so, can F.prevIter() be overwritten simply by using F.storePrevIter();? Where both of them are being stored per default: at runTime.write(), runTime++ or somewhere else?

In GeometricField.C I saw additional outputs while using storePrevIter() and storeOldTime() inside of if(debug){}. How the debug mode can be switched on?

best regards,
ilya
linch 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
compilation problem with "fvPatch::lookupPatchField" Ya_Squall2010 OpenFOAM Programming & Development 9 November 15, 2021 23:01
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 19:00
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
Accessing phi from a fvPatchField at same patch johndeas OpenFOAM 1 September 13, 2010 21:23
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


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