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, 12:36
Default codedBoundary Condition
  #1
New Member
 
Rishi Kumar
Join Date: Jun 2022
Posts: 20
Rep Power: 3
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, 6 views)
__________________
Rishi K.
rishik686 is offline   Reply With Quote

Old   December 26, 2022, 12:29
Default
  #2
Member
 
Join Date: Jun 2020
Posts: 49
Rep Power: 5
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, 04:07
Default
  #3
New Member
 
Rishi Kumar
Join Date: Jun 2022
Posts: 20
Rep Power: 3
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 07:29
Boundary Condition for Pump simulation for Zero Head Condition Himanshu_Shrivastava Main CFD Forum 0 March 26, 2017 03:25
Similar boundary condition to zero flux condition Navip OpenFOAM Running, Solving & CFD 0 August 13, 2015 04:04
Accessing multiple boundary patches from a custom boundary condition file ripudaman OpenFOAM Programming & Development 0 October 22, 2014 18:34
what "If" condition means in rebound brbbhatti OpenFOAM Programming & Development 0 August 12, 2014 09:18


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