CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How To Modify the eqution (https://www.cfd-online.com/Forums/openfoam-solving/58995-how-modify-eqution.html)

yinyajun436 March 26, 2008 00:39

Hi,everyone! I want to add the
 
Hi,everyone! I want to add the V * dT/dx to the laplacian slover. And the V is the const value in the x direction. Thank you for hint .It is very good if there is a similar example.

schmidt_d March 31, 2008 17:01

Setting a constant in the code
 
Setting a constant in the code:

const dimensionedScalar hconst
(
"hconst",
dimensionSet(0, 2, -2, 0, 0, 0, 0),
800.0e3
);

Reading a constant from an input file, which is usually a better idea is easy. Just check out readTransportProperties.H for any of the CFD codes.

fvc::grad(T) would give you the gradient of T. You can dot this with a unit vector in the x direction. Set the constant vector xhat, similar to the scalar example above and do the dot product using the & operator. There might be a method of taking just the x component if you dig through the vector class, but I don't know off the top of my head.

-DPS


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