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

pointScalarField patch names

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2018, 13:38
Default pointScalarField patch names
  #1
jlr
New Member
 
Join Date: Sep 2018
Posts: 6
Rep Power: 8
jlr is on a distinguished road
Hi,

I am trying to use a pointScalarField in my solver for foam-extend 4.0, which compiles with no issue. However, while running the solver crashes with a segmentation fault at output timesteps.

Debugging I know the crashing line is GeometricBoundaryField.C:530

Code:
this->operator[](patchi).patch().name()
It crashes when calling the name() method. patch() returns a pointPatch object.

The name() method in the pointPatch class is a pure virtual function (see pointPatch.H:127), so that's why calling it crashes the solver. Debugging other foam-extend's default solvers that use a pointTypeField it seems most call the name() method from facePointPatch, which is a base class for most pointPatch types.

So, I guess the problem is that the patches of my pointScalarField are not of any type. Shouldn't they know the type from boundary definitions at polymesh/boundary?. All of my patches are of type patch. I just don't see what I'm doing differently from the default solvers...

Thank you
jlr is offline   Reply With Quote

Old   September 21, 2018, 04:58
Default
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Hi,

My guess is that the pointMesh is not constructed correctly.

Just callin a normal constructor won’t do: you need a reference to a meshObject

Const pointMesh& pm = pointMesh::New(mesh);

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   September 21, 2018, 13:16
Default
  #3
jlr
New Member
 
Join Date: Sep 2018
Posts: 6
Rep Power: 8
jlr is on a distinguished road
Turns out my (silly) mistake was creating the pointMesh object locally on a function, thus erasing it from memory once the function ended.

Thank you for your help!
jlr is offline   Reply With Quote

Old   September 21, 2018, 18:36
Default
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
What can I say debugging service without looking at the code!

I think I’ll call myself Professor for the rest of the day...
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak 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
y+ and u+ values with low-Re RANS turbulence models: utility + testcase florian_krause OpenFOAM 114 August 23, 2023 06:37
Near wall treatment in k-omega SST Arnoldinho OpenFOAM Running, Solving & CFD 38 March 8, 2017 14:48
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


All times are GMT -4. The time now is 03:20.