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/)
-   -   volVectorField (https://www.cfd-online.com/Forums/openfoam-programming-development/118761-volvectorfield.html)

haghgoo_reza June 3, 2013 23:36

volVectorField
 
Hello all,

I am trying to define a vector in openFoam with the following equation:
A = -fvc::div(phi, U)+fvc::laplacian(nu, U)

do you think I can use the following command to define my vector i.e. A.

volVectorField A("A", U);
A = -fvc::div(phi, U)+fvc::laplacian(nu, U);

I can not understand the meaning of A("A", U) in volVectorField A("A", U);

can anybody help me?

Thanks

Cyp June 4, 2013 05:29

Hi,

Code:

volVectorField A("A", U);
means that your are creating a new volVectorField object declared as A. This object has to be constructed with a name, a dimension, a mesh.... Among the different constructors available, you can construct A from a name, and another volVectorField (U in this example). The main problem in your snippet is that with such a declaration, A should have the same dimensions as U. But it's wrong... I think the following code is better :

Code:

volVectorField A("A", -fvc::div(phi, U)+fvc::laplacian(nu, U));
Best,
Cyp


All times are GMT -4. The time now is 05:45.