# declaration of an empty fvScalarMatrix

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

 November 11, 2011, 11:32 declaration of an empty fvScalarMatrix #1 Senior Member   Illya Shevchuk Join Date: Aug 2009 Location: Darmstadt, Germany Posts: 176 Rep Power: 9 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

 November 14, 2011, 07:28 #2 Senior Member   Steven van Haren Join Date: Aug 2010 Location: The Netherlands Posts: 149 Rep Power: 8 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.

 November 17, 2011, 08:09 #3 Senior Member   Illya Shevchuk Join Date: Aug 2009 Location: Darmstadt, Germany Posts: 176 Rep Power: 9 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; im;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

 November 22, 2011, 10:11 #4 Senior Member   Illya Shevchuk Join Date: Aug 2009 Location: Darmstadt, Germany Posts: 176 Rep Power: 9 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

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post gschaider OpenFOAM 300 October 29, 2014 19:00 Ya_Squall2010 OpenFOAM Programming & Development 7 October 27, 2014 11:24 Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42 johndeas OpenFOAM 1 September 13, 2010 20:23 jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51

All times are GMT -4. The time now is 14:23.