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

Problem about fvm::grad

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By yhaomin2007

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 9, 2012, 18:00
Default Problem about fvm::grad
  #1
Member
 
Haomin Yuan
Join Date: Jan 2012
Location: Madison, Wisconsin, USA
Posts: 59
Rep Power: 14
yhaomin2007 is on a distinguished road
HI, ALL

As you know, in OF, the gradient operator only has fvc type. But if we want to write a coupled algorithm, we have the make a fvm::grad function.

I have write fvmGrad.C file define the fvm::grad function. Since the gradient of a scalar field is a vector field. So the gradient matrix should actually be three different scalar matrix, returns each component separately by multiple p scalar field.

Now I have met two problems, first is about the initialization of the faceInterpolationScheme. Can some body give a example how to initial a faceInterpolationScheme?? I need this is because I need the weight to interpolation cell value to get face value.

The second problem is that when I initial the matrix coefficient like this
Quote:
const vectorField& Sf = mesh.Sf();

const labelUList& owner = mesh.owner();

const scalar* lowerPtr = fvm.lower().begin();
const scalar* upperPtr = fvm.upper().begin();
const scalar* diagPtr = fvm.diag().begin();
scalar S;

forAll(owner,facei)
{
S = Sf[facei].component(0) * weights[facei];
&lowerPtr[facei] = S;
&upperPtr[facei] = Sf[facei].component(0) - S;
}
The compilation of the finiteVolume is ok, but when I compile the solver that use fvm::grad(p), it returns the error
Quote:
lvalue required as left operand of assignment
I do not know what this means.

Has anybody tried to do this before??

thank you in advance
Kummi likes this.
yhaomin2007 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 05:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 06:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 07:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 20:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 15:52


All times are GMT -4. The time now is 14:35.