|
[Sponsors] |
July 18, 2018, 06:44 |
Matrix manipulation
|
#1 |
New Member
Join Date: Jan 2013
Posts: 17
Rep Power: 13 |
Hi Foamers!
I would like to manipulate my matrix using an implicit relaxation. The relaxation factor is individual for each cell and may also be 0. My solution is working very good, but only for serial simulations not in parallel simulations. I assume the problem are the coupled boundaries. Maybe somebody can tell me, how to manipulate the matrix correctly, and how the neighbor elements are stored if the belonging cell is on a different processor. Here is my current approach: r is a volScalarField and represents the relaxation factor 0 <= r <= 1.0 Code:
const unallocLabelList& l = omegaEqn().lduAddr().lowerAddr(); const unallocLabelList& u = omegaEqn().lduAddr().upperAddr(); omegaEqn().source() = (r * omegaEqn().source()) + ((1-r) * omegaEqn().diag() * omegaTarget); if(omegaEqn().hasLower()) { scalarField& lower = omegaEqn().lower(); for (label face_=0; face_<l.size(); face_++) { { lower[face_] *= r[l[face_]]; } } } if(omegaEqn().hasUpper()) { scalarField& upper = omegaEqn().upper(); for (label face_=0; face_<u.size(); face_++) { { upper[face_] *= r[u[face_]]; } } } Za-ck |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Convection Diffusion 1-D Matrix Problem | balrog | Main CFD Forum | 1 | November 3, 2014 14:34 |
Matrix manipulation | Linse | OpenFOAM Programming & Development | 15 | May 25, 2014 09:05 |
more equation in block matrix system | yhaomin2007 | OpenFOAM | 1 | September 6, 2012 09:33 |
Force can not converge | colopolo | CFX | 13 | October 4, 2011 23:03 |
OpenFOAM version 1.6 details | lakeat | OpenFOAM Running, Solving & CFD | 42 | August 26, 2009 22:47 |