CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Math form expressed in OpenFoam (https://www.cfd-online.com/Forums/openfoam-pre-processing/62251-math-form-expressed-openfoam.html)

 vvqf November 10, 2005 04:34

volVectorField A = (a, b, c)

volVectorField A = (a, b, c)
volVectorField U = (u, v, w)

a*Ñu + b*Ñv + c*Ñw

How to describe this expression in OpenFoam?

I express it as A*grad(U), grad(U) is then a tensor. Is that right?
I tried many ways to denote it in the codes, well, each time i got errors like "no match ..."

ps:
in OpenFoam,(U . Ñ)U is expressed as div(phi,U), phi = rho*U?

 vvqf November 10, 2005 08:26

original form: a¶xu + b¶

original form:

axu + b<font size="-1">xv + cxw</font>
ayu + b<font size="-1">yv + cyw</font>
azu + b<font size="-1">zv + czw</font>

Thanks a lot.

 eugene November 10, 2005 08:35

http://foam.sourceforge.net/do

http://foam.sourceforge.net/doc/Guid...mmersGuide.pdf

Check section one for a general overview of OpenFOAM tensor algebra and notation. Very useful document IMO.

 vvqf November 10, 2005 09:50

Thank you so much. I mixed

Thank you so much.

I mixed * and &.

and operator calculation order is the written/appearing order, *, /, ect, do not have precedence to +, -.

 grtabor November 10, 2005 10:38

Yes - the one thing you can't

Yes - the one thing you can't redefine (or one of the things you can't redefine) in c++ is the order of precedence for the various binary operators. Its probably worth adding lots of brackets into your expressions to compensate for this.

Gavin

 All times are GMT -4. The time now is 07:04.