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

cmptMag(g.value()) and mag(g.value())

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2016, 04:26
Default cmptMag(g.value()) and mag(g.value())
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Hi guys,

In readgh.H, we have:

Code:
dimensionedScalar ghRef
    (
        mag(g.value()) > SMALL
      ? g & (cmptMag(g.value())/mag(g.value()))*hRef
      : dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
    );
g.value() is a scalar. So in my opinion, cmptMag(g.value()) and mag(g.value()) is the same. Why do we need this operation?

Code:
inline Scalar cmptMag(const Scalar s)
  277 {
  278     return mag(s);
  279 }
__________________
My OpenFOAM algorithm website: http://dyfluid.com
By far the largest Chinese CFD-based forum: http://www.cfd-china.com/category/6/openfoam
We provide lots of clusters to Chinese customers, and we are considering to do business overseas: http://dyfluid.com/DMCmodel.html
sharonyue is offline   Reply With Quote

Old   March 6, 2016, 09:12
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

In general g is uniformDimensionedVectorField, so g.value() is vector (http://foam.sourceforge.net/docs/cpp/a02728.html).
sharonyue, wwzhao and Milica like this.
alexeym 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 01:31.