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

Custom boundary condition : type instantiation

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Benben

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 29, 2018, 05:34
Default Custom boundary condition : type instantiation
  #1
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 8
Benben is on a distinguished road
Hello,

I am using OpenFoam 6.
I am trying to compile a boundary condition made to calculates a species mass fraction. (I want to set the mass fraction in order to impose a partial pressure "P_ref" of species in the gas).
I created a class that inherits from "FixedValuefvPatchField".
My mass fraction is roughly calculated as :
Code:
(*this)[faceID] = P_ref * M / (Rho[faceID] * R * T[faceID])
With the right term of the equation beeing a scalar.

However, when compiling my class, i get the error :
Code:
evaporatingZinc_RDMP/evaporatingZinc_RDMPFvPatchField.C: In instantiation of 'void Foam::evaporatingZinc_RDMPFvPatchField<Type>::updateCoeffs() [with Type = Foam::Vector<double>]':
evaporatingZinc_RDMP/evaporatingZinc_RDMPFvPatchFields.C:41:1:   required from here
evaporatingZinc_RDMP/evaporatingZinc_RDMPFvPatchField.C:153:18: error: no match for 'operator=' (operand types are 'Foam::Vector<double>' and 'double')
Which means that, when the type of my class is instantiated as a "Vector<scalar>", affecting a scalar to it raises an error.

I want to use this boundary condition on scalars only (species mass fractions ...). Is there any way to prevent this instantiation to be made ?
Benben is offline   Reply With Quote

Old   August 30, 2018, 04:47
Default
  #2
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 8
Benben is on a distinguished road
This was due to the fact that i tried to copy and modify the "fixedValueFvPatchField" folder instead of using the utility "FoamNewBC -f -s myBoundaryCondition" (type "foamNewBC -h" for informations on how to use).
yueyun likes this.
Benben 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
Radiation interface hinca CFX 15 January 26, 2014 17:11
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
singularity? mihaipruna OpenFOAM Running, Solving & CFD 5 April 24, 2012 17:18
Pressure instability with rhoSimpleFoam daniel_mills OpenFOAM Running, Solving & CFD 44 February 17, 2011 17:08
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 07:34.