|
[Sponsors] |
Custom boundary condition rotation angle access |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Adrian del Ser
Join Date: Oct 2021
Posts: 15
Rep Power: 4 ![]() |
Hi everyone,
I'm trying to create a custom codedFixedValue boundary condition that depends on the angle of rotation and angular velocity of a rotating rigid body. The motion solver is sixDoFRigidBodyMotion. Inside controlDict, one can add the following code to print out this data: Code:
functions { sixDoFRigidBodyState { type sixDoFRigidBodyState; libs ("libsixDoFRigidBodyState.so"); angleFormat degrees; } } I have found this code which gets access to db() or patch() to set a sinusoidal boundary condition in space, but I am not sure how to get to sixDoFRigidBodyState and the values it contains: Code:
codedPatch { type codedFixedValue; value uniform 0; name codedPatchBC; // name of generated BC code #{ //const scalar t = this -> db().time().value(); const scalar pi = constant::mathematical::pi; const fvPatch& patch = this -> patch(); const vectorField& cf = patch.Cf(); const scalar l = 0.1; scalarField& field = *this; forAll(cf, i) { field[i] = 273+100*sin((2*pi/l)*cf[i].x()); } #}; Adrian |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 ![]() |
From this file it seems you have to access the motion solver
https://develop.openfoam.com/Develop...gidBodyState.C The the function motion() returns the motion state Best Michael |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 ![]() |
Probably you have to write this lines in your function object
Code:
. const sixDoFRigidBodyMotionSolver& motionSolver_ = refCast<const sixDoFRigidBodyMotionSolver>(mesh.motion()); const sixDoFRigidBodyMotion& motion = motionSolver_.motion(); |
|
![]() |
![]() |
![]() |
![]() |
#4 | |
New Member
Adrian del Ser
Join Date: Oct 2021
Posts: 15
Rep Power: 4 ![]() |
Quote:
Thanks! I'll be testing this soon, is this something you can put directly in the code block of the custom boundary condition? |
||
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 ![]() |
Yes yes. You have to access the value at the boundary
|
|
![]() |
![]() |
![]() |
Tags |
boundary condition, codedfixedvalue, sixdofrigidbodymotion |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 60 | July 17, 2024 05:45 |
Constant mass flow rate boundary condition | sahm | OpenFOAM | 0 | June 20, 2018 22:45 |
Constant contact angle boundary condition | sdeb31 | FLUENT | 0 | January 12, 2018 12:13 |
Error - Solar absorber - Solar Thermal Radiation | MichaelK | CFX | 12 | September 1, 2016 05:15 |
External Radiation Boundary Condition (Two sided wall), Grid Interface | CFD XUE | FLUENT | 0 | July 8, 2010 06:49 |