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.
Setting a constant in the code
Setting a constant in the code:
const dimensionedScalar hconst
dimensionSet(0, 2, -2, 0, 0, 0, 0),
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.
|All times are GMT -4. The time now is 12:46.|