|
[Sponsors] |
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: 17 |
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: 16 |
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: 17 |
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; } 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: 17 |
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 |
|
|
|
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 |