CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Asking Questions about the Flux phi and the source() of fvVectorMatrix (https://www.cfd-online.com/Forums/openfoam-programming-development/177801-asking-questions-about-flux-phi-source-fvvectormatrix.html)

mengweilm425 September 21, 2016 08:41

Asking Questions about the Flux phi and the source() of fvVectorMatrix
 
Dear Foamers,

I am using Foam-dev, and the following questions are associated with the tutorial case 'cavity' using the 'icoFoam' solver.

A 4 by 4 grid was used in order to have a closer look at the variables.



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) (4 4 1) simpleGrading (1 1 1)
);

Question 1:

when I was trying to check the 'phi' values using

Info<< " phi " << phi << nl <<endl;

Info<< " phi size " << phi.size() << nl <<endl;

I got the output as follows:

phi dimensions [0 3 -1 0 0 0 0];

internalField nonuniform List<scalar>
24
(
-2.28233e-06
2.28233e-06
-3.2402e-06
9.57866e-07
-2.28434e-06
-9.55866e-07
-2.28433e-06
-3.94416e-06
6.22649e-06
-5.34147e-06
2.35517e-06
-3.95016e-06
-2.34716e-06
-6.2345e-06
-6.72257e-06
1.29491e-05
-7.99247e-06
3.62507e-06
-6.71657e-06
-3.62306e-06
-1.29511e-05
1.29491e-05
1.65741e-05
1.29511e-05
)
;

boundaryField
{
movingWall
{
type calculated;
value uniform 0;
}
fixedWalls
{
type calculated;
value uniform 0;
}
frontAndBack
{
type empty;
value nonuniform 0();
}
}


phi size 24


My question is: there are 72 faces including internal and boundary one, why is the phi only defined on the internal faces rather than the boundary? Or how the boundary flux is considered in 'fvm::div(phi, U)'?


Question 2:

I created a new fvVectorMatrix as follows:

fvVectorMatrix UEqn_time_term
(
fvm::ddt(U)
);

, and output the source of UEqn_time_term

Info<< " UEqn_time_term.s " << UEqn_time_term.source() << nl << endl;

I got the following numbers:

UEqn_time_term.s
16
(
(-5.83396e-06 5.74984e-06 0)
(-1.42259e-05 2.43986e-06 0)
(-1.42171e-05 -2.34961e-06 0)
(-5.92331e-06 -5.6699e-06 0)
(-1.00527e-05 2.19123e-05 0)
(-2.40783e-05 8.37173e-06 0)
(-2.41399e-05 -8.28764e-06 0)
(-1.01346e-05 -2.19111e-05 0)
(-1.39378e-05 4.90818e-05 0)
(-3.80295e-05 1.57254e-05 0)
(-3.80131e-05 -1.56865e-05 0)
(-1.39231e-05 -4.90753e-05 0)
(9.96865e-05 3.28844e-05 0)
(7.57897e-05 9.67425e-06 0)
(7.57862e-05 -9.65121e-06 0)
(9.97123e-05 -3.2868e-05 0)
)


I am wondering why the source of UEqn_time_term is not always '0' as I only introduced 'fvm::ddt(U)'?


Thank you in advance for your help!

Regards,

Wei


All times are GMT -4. The time now is 10:12.