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/)
-   -   how to change scaler fields to vector field (https://www.cfd-online.com/Forums/openfoam-programming-development/142535-how-change-scaler-fields-vector-field.html)

1988 October 3, 2014 14:18

how to change scaler fields to vector field
 
Dear Foamers
I have defined an equation which was scalar ,but right now I want to change it to vector field,how can i do that?
Code:

fvScalarMatrix CEqn
(
    fvm::ddt(C)
  + fvm::div(phi, C)
 ==
    fvm::laplacian(D,C)
);

CEqn.relax();

CEqn.solve();

//C=min(max(0.0,C),1.0);


kmooney October 9, 2014 16:34

Hi Ali,

I think a logical first step here would be to attempt to change the word 'Scalar' to 'Vector' in your declarations.

Quote:

Originally Posted by 1988 (Post 512835)
Dear Foamers
I have defined an equation which was scalar ,but right now I want to change it to vector field,how can i do that?
Code:

fvScalarMatrix CEqn
(
    fvm::ddt(C)
  + fvm::div(phi, C)
 ==
    fvm::laplacian(D,C)
);

CEqn.relax();

CEqn.solve();

//C=min(max(0.0,C),1.0);




All times are GMT -4. The time now is 20:38.