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

codedBoundary Condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 24, 2022, 13:36
Default codedBoundary Condition
  #1
New Member
 
Rishi Kumar
Join Date: Jun 2022
Posts: 20
Rep Power: 4
rishik686 is on a distinguished road
Hi everyone,
I am trying to implement a time-varying velocity inlet boundary condition.

by using codedFixedValue type.

But, i am getting the follwing error while compiling,

error: return-statement with a value, in function returning ‘void’ [-fpermissive]

I have attached my U file also,

Please help me out to overcome this error.
Attached Files
File Type: txt U.txt (1.5 KB, 9 views)
__________________
Rishi K.
rishik686 is offline   Reply With Quote

Old   December 26, 2022, 13:29
Default
  #2
Member
 
Join Date: Jun 2020
Posts: 49
Rep Power: 6
Swirl is on a distinguished road
I think your error lies in using the "return" statement, since the function is aparently defined as a void (which doesn't have a return value). The C++ source guide gives an example of how to use this type of BC:

https://cpp.openfoam.org/v10/classFo...atchField.html

I think, in your case it could look something like:
Code:
const scalar t = this->db().time().value();
operator==(<description of U-vector here>);
Swirl is offline   Reply With Quote

Old   December 30, 2022, 05:07
Default
  #3
New Member
 
Rishi Kumar
Join Date: Jun 2022
Posts: 20
Rep Power: 4
rishik686 is on a distinguished road
Quote:
Originally Posted by Swirl View Post
I think your error lies in using the "return" statement, since the function is aparently defined as a void (which doesn't have a return value). The C++ source guide gives an example of how to use this type of BC:

https://cpp.openfoam.org/v10/classFo...atchField.html

I think, in your case it could look something like:
Code:
const scalar t = this->db().time().value();
operator==(<description of U-vector here>);
thanks swirl,
i corrected it,need to rewritr the code with operator.
thanks for your help
__________________
Rishi K.
rishik686 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
The difference of cyclic boundry condition and mapped boundary condition caitao OpenFOAM Running, Solving & CFD 1 December 4, 2019 08:29
Boundary Condition for Pump simulation for Zero Head Condition Himanshu_Shrivastava Main CFD Forum 0 March 26, 2017 04:25
Similar boundary condition to zero flux condition Navip OpenFOAM Running, Solving & CFD 0 August 13, 2015 05:04
Accessing multiple boundary patches from a custom boundary condition file ripudaman OpenFOAM Programming & Development 0 October 22, 2014 19:34
what "If" condition means in rebound brbbhatti OpenFOAM Programming & Development 0 August 12, 2014 10:18


All times are GMT -4. The time now is 09:51.