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

Problems with FAM (fac::grad)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 14, 2017, 06:14
Default Problems with FAM (fac::grad)
  #1
New Member
 
Martin Kerz
Join Date: Dec 2017
Posts: 3
Rep Power: 9
martinK. is on a distinguished road
Hello Dear Forum Users,
as I'm new to the forum firstly I would like to say hi and thank you for all the helpful answers you've done already. I started of with OpenFoam few weeks ago and found help here multiple times yet.
Right now I'm stuck for quite a while and can't help me for myself (still I hope it's quite an easy and trivial problem and it's just due to my inability)...

I'm using foam extend 3.2 and try to write a solver for the shallow water equations based on the finite-area-method. Implementing the equations was straight-forward but while performing some calculations I get an error when compiling:

Code:
// S and H: areaScalarFields, g: dimensionedScalar
areaScalarField  absWL = g*(S+H);
edgeScalarField absWLEdge = fac::interpolate(absWL);
areaVectorField absWLGrad = fac::grad(absWLEdge);
throws:
Code:
/foam-extend-3.2/foam-extend-3.2/src/finiteArea/lnInclude/facGrad.C:58:47: 
error: ‘const Mesh’ has no member named ‘Sf’
     return fac::edgeIntegrate(ssf.mesh().Sf() * ssf);
What I've found out:
- fac::grad(ssf) just calls fac::edgeIntegrate(ssf.mesh().Sf() * ssf)
(where ssf is an edgeMesh)
- ssf.mesh() returns acess to the polyMesh of the faMesh
- the polyMesh should have the member Sf() (returning the surface normal vectors)

Playing around, I tried for example
Code:
areaVectorField absWLGrad = fac::edgeIntegrate(absWLEdge.mesh().Le() * absWLEdge);
where .Le() is the corresponding member function of the faMesh returning the edge normal vectors.
This compiled but I got unphysical results...
And, first of all, I do think that the errors much more likely to be caused by me than by a bug

I'm a little desperate right now and can't find that much documentation about the FAM... any help or comment would be appreciated!

Thank you very much!

Martin
martinK. is offline   Reply With Quote

Old   January 17, 2018, 10:34
Default
  #2
New Member
 
Martin Kerz
Join Date: Dec 2017
Posts: 3
Rep Power: 9
martinK. is on a distinguished road
Just in case anybody else stumbles across this:
In the end it worked fine for me when I just left out the middle-line:
Code:
areaScalarField absWL = g*(S+H);
areaVectorField absWLGrad = fac::grad(absWL);
seems like the fac::grad doesn't need an edgeMesh as input...
martinK. is offline   Reply With Quote

Old   March 13, 2018, 09:08
Smile
  #3
New Member
 
LXJ
Join Date: Apr 2015
Posts: 12
Rep Power: 11
liuxiaojian2015 is on a distinguished road
Quote:
Originally Posted by martinK. View Post
Just in case anybody else stumbles across this:
In the end it worked fine for me when I just left out the middle-line:
Code:
areaScalarField absWL = g*(S+H);
areaVectorField absWLGrad = fac::grad(absWL);
seems like the fac::grad doesn't need an edgeMesh as input...
Hi martink,

I found there is a problem related to fac::grad() in patch junction. Which I explained here: The problem of bed load transport rate based on FE3.2-famesh.

If you have understand how to use it or also in doubt, welcome you to discuss it. Thank you.
liuxiaojian2015 is offline   Reply With Quote

Reply

Tags
fam, finite area method, gradient


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
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 6 December 1, 2020 12:12
[mesh manipulation] Problems with rotational cyclic boundaries TReviol OpenFOAM Meshing & Mesh Conversion 8 July 11, 2014 04:45
[ICEM] Flow channel meshing problems StefanG ANSYS Meshing & Geometry 19 May 15, 2012 07:44
Two-phase air water flow problems by activating Wall Lubrication Force challenger85 CFX 5 November 5, 2009 06:44
Help required to solve Hydraulic related problems aero CFX 0 October 30, 2006 12:00


All times are GMT -4. The time now is 16:25.