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

Access volume field in the boundary condition of a point field

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 31, 2020, 13:10
Post Access volume field in the boundary condition of a point field
  #1
New Member
 
peyman havaej
Join Date: Jan 2016
Posts: 16
Rep Power: 10
peyman.havaej is on a distinguished road
Dear Foamers

I have developed a new boundary condition for a point field. In this boundary condition, I need to calculate forces that act on a specific surface; therefore, I have loaded pressure from the object registry. The code was compiled successfully but whenever I run a case with this boundary and the code wants to access to pressure field (please see below), I receive the floating-point error.

here is the code:

Code:
	const polyMesh&  pointMeshIF = this->dimensionedInternalField().mesh()();
	
	const volScalarField& p_ = pointMeshIF.thisDb().lookupObject<volScalarField>("p");

	const fvMesh& mesh = p_.mesh();

	label IDts = mesh.boundaryMesh().findPatchID(targetSurface_);
  
 	scalarField targetPatchPressureField  = p_.boundaryField()[IDts];
I could not find the actual problem, but I am sure that floating-point error is because of loading volume fields (pressure). I think it should be possible to use a volume Field in the calculation of a point field.


I will appreciate it if anyone has any idea or suggestion about this problem.

Kind regards,
Peyman
peyman.havaej is offline   Reply With Quote

Reply

Tags
boundary condition, object registry, openfoam, point fields, programing


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
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 06:15
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
[snappyHexMesh] determining displacement for added points CFDnewbie147 OpenFOAM Meshing & Mesh Conversion 1 October 22, 2013 10:53
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05


All times are GMT -4. The time now is 08:58.