CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Ueqn.A() extract the diag. term from the Ueqn?? (http://www.cfd-online.com/Forums/openfoam-programming-development/120229-ueqn-extract-diag-term-ueqn.html)

sharonyue July 2, 2013 23:19

Ueqn.A() extract the diag. term from the Ueqn??
 
I just made a testify, add this code into icoFoam:
Code:

fvVectorMatrix UEqn
        (
            fvm::ddt(U)
          + fvm::div(phi, U)
          - fvm::laplacian(nu, U)
        );

Info<<"UEqn:" << UEqn << endl;
Info<<"UEqn.A():" << UEqn.A()<< endl;
Info<<"UEqn.H():" << UEqn.H()<< endl; 
   
        //solve(UEqn == -fvc::grad(p));

        // --- PISO loop

Then I run a 9 nodes cavity case. It output this in the first timestep:
Code:

Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

Reading/calculating face flux field phi


Starting time loop

Time = 0.005

Courant Number mean: 0 max: 0
UEqn:Lower triangle =
12
(
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
)


diagonal = 9(0.00012 0.00015 0.00012 0.00015 0.00018 0.00015 0.00012 0.00015 0.00012)

Upper triangle =
12
(
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
-3e-05
)



[0 4 -2 0 0 0 0]
9{(0 0 0)}

3
(
3((6e-05 6e-05 6e-05) (6e-05 6e-05 6e-05) (6e-05 6e-05 6e-05))
9((6e-05 6e-05 6e-05) (6e-05 6e-05 6e-05) (6e-05 6e-05 6e-05) (6e-05 6e-05 6e-05) (6e-05 6e-05 6e-05) (6e-05 6e-05 6e-05) (6e-05 6e-05 6e-05) (6e-05 6e-05 6e-05) (6e-05 6e-05 6e-05))
0()
)


3
(
3((6e-05 0 0) (6e-05 0 0) (6e-05 0 0))
9{(0 0 0)}
0()
)


UEqn.A():dimensions      [0 0 -1 0 0 0 0];

internalField  nonuniform List<scalar> 9(800 700 800 700 600 700 800 700 800);

boundaryField
{
    movingWall
    {
        type            zeroGradient;
    }
    fixedWalls
    {
        type            zeroGradient;
    }
    frontAndBack
    {
        type            empty;
    }
}

UEqn.H():dimensions      [0 1 -2 0 0 0 0];

internalField  nonuniform List<vector> 9((0 0 0) (0 0 0) (0 0 0) (0 0 0) (0 0 0) (0 0 0) (200 0 0) (200 0 0) (200 0 0));

boundaryField
{
    movingWall
    {
        type            zeroGradient;
    }
    fixedWalls
    {
        type            zeroGradient;
    }
    frontAndBack
    {
        type            empty;
    }
}

So in this log, Why Ueqn.A()'s internal field is not equal to the Ueqn's diag. term? I mark this two in the red.

Thanks in advance,

sharonyue July 4, 2013 05:40

If A()=diag()/mesh.V(),
this is my mesh:

Code:

convertToMeters 0.03;

vertices
(
    (0 0 0)
    (1 0 0)
    (1 1 0)
    (0 1 0)
    (0 0 0.1)
    (1 0 0.1)
    (1 1 0.1)
    (0 1 0.1)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (3 3 1) simpleGrading (1 1 1)
);

So V is 0.003*0.01*0.01=0.000003.
but 0.00012/0.000003 does not equal to 800.

Martin80 July 24, 2013 11:08

Hi,

Ueqn.A()=diag()/mesh.V() holds true only for cells, which do not contact the boundary. E.g. in your example:

600=0.00018/(0.01*0.01*0.003)

[and be careful mesh.V()=3e-7 (not 3e-6)].

At the moment I'm also trying to clarify details about the "Ueqn.A()".

B.r. Martin.

sharonyue July 24, 2013 11:12

Quote:

Originally Posted by Martin80 (Post 441732)
Hi,

Ueqn.A()=diag()/mesh.V() holds true only for cells, which do not contact the boundary. E.g. in your example:

600=0.00018/(0.01*0.01*0.003)

[and be careful mesh.V()=3e-7 (not 3e-6)].

At the moment I'm also trying to clarify details about the "Ueqn.A()".

B.r. Martin.

So this is only true for inner cells, not boundary cells. Thats clear! Thx very much!


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