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

Matrix manipulation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 18, 2018, 06:44
Default Matrix manipulation
  #1
New Member
 
Join Date: Jan 2013
Posts: 17
Rep Power: 13
Za-ck is on a distinguished road
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_]];
                }
            }
        }
Best regards,
Za-ck
Za-ck 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
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


All times are GMT -4. The time now is 17:52.