|
[Sponsors] |
Custom boundary condition rotation angle access |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 11, 2022, 14:23 |
Custom boundary condition rotation angle access
|
#1 |
New Member
Adrian del Ser
Join Date: Oct 2021
Posts: 15
Rep Power: 5 |
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 |
|
February 12, 2022, 04:11 |
|
#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 |
|
February 12, 2022, 04:17 |
|
#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(); |
|
February 17, 2022, 05:11 |
|
#4 | |
New Member
Adrian del Ser
Join Date: Oct 2021
Posts: 15
Rep Power: 5 |
Quote:
Thanks! I'll be testing this soon, is this something you can put directly in the code block of the custom boundary condition? |
||
February 17, 2022, 13:09 |
|
#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 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 60 | July 17, 2024 06:45 |
Constant mass flow rate boundary condition | sahm | OpenFOAM | 0 | June 20, 2018 23:45 |
Constant contact angle boundary condition | sdeb31 | FLUENT | 0 | January 12, 2018 13:13 |
Error - Solar absorber - Solar Thermal Radiation | MichaelK | CFX | 12 | September 1, 2016 06:15 |
External Radiation Boundary Condition (Two sided wall), Grid Interface | CFD XUE | FLUENT | 0 | July 8, 2010 07:49 |