CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Inner product of a tensor and a vector in fvScalarMatrix

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2014, 15:39
Default Inner product of a tensor and a vector in fvScalarMatrix
  #1
New Member
 
Xiangyu Gao
Join Date: Sep 2013
Location: West Lafayette, IN, USA
Posts: 29
Rep Power: 13
gxy200992243 is on a distinguished road
Hi, everyone!

Now I want to express the equation below in fvScalarMatrix, where uj is a velocity vector, p is the pressure, and M is a constant Mach Number.

M^2\frac{\partial p}{\partial t}+M^2u_j \frac{\partial p}{\partial x_j} + \frac{\partial u_j}{\partial x_j} = 0

I wrote LHS of this equation in fvScalarMatrix as
Code:
fvm::ddt(p)+U & fvc::grad(p)+ fvc::div(U/M/M)
But the compiler told me:' const Foam::Vector<double>' is not derived from 'const Foam::dimensioned<Type>'

I think something must be wrong with my expression in fvScalarMatrix. Can anyone help me correct it?

I also want to know how to treat grad(p) implicitly. I have searched in the forum about implicit gradient for a long time, but I still cannot get the answer.

Billions of thanks,

Xiangyu
gxy200992243 is offline   Reply With Quote

Old   October 13, 2014, 11:08
Smile
  #2
Senior Member
 
Join Date: Sep 2010
Posts: 226
Rep Power: 17
T.D. is on a distinguished road
Hi,

Try:

fvm::ddt(p)+U & fvc::grad(p)+ pow(M,-2)*fvc::gGrad(U)

Pay attention for the dimensions too.

Good Luck !



Quote:
Originally Posted by gxy200992243 View Post
Hi, everyone!

Now I want to express the equation below in fvScalarMatrix, where uj is a velocity vector, p is the pressure, and M is a constant Mach Number.

M^2\frac{\partial p}{\partial t}+M^2u_j \frac{\partial p}{\partial x_j} + \frac{\partial u_j}{\partial x_j} = 0

I wrote LHS of this equation in fvScalarMatrix as
Code:
fvm::ddt(p)+U & fvc::grad(p)+ fvc::div(U/M/M)
But the compiler told me:' const Foam::Vector<double>' is not derived from 'const Foam::dimensioned<Type>'

I think something must be wrong with my expression in fvScalarMatrix. Can anyone help me correct it?

I also want to know how to treat grad(p) implicitly. I have searched in the forum about implicit gradient for a long time, but I still cannot get the answer.

Billions of thanks,

Xiangyu
T.D. is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 18:47.