|
[Sponsors] |
April 19, 2023, 14:12 |
A function of time boundary condition
|
#1 |
New Member
abdellah
Join Date: Apr 2023
Posts: 2
Rep Power: 0 |
Hello everyone,
i'm trying to set a boundary condition to simulate a speaker, therefore the following equation is used for the pressure field: pm+pa*cos(2*pi*F*T) so i'm trying to set this function as a boundary condition for the pressure field, tried the BC type waveTransmissive but it's tricky to use. according to Chat gpt this is the way it's used: inlet { type waveTransmissive; waveType function; functionObjectLibs ("libsampling.so"); functionObjectDict { type genericFunctionObject; outputControl timeStep; enabled true; function "0.5*sin(2*pi*2*time)"; fields (U); } } but it's not working so how to set a function of time as a boundary condition (any desired function). thank you'all |
|
April 20, 2023, 03:51 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,695
Rep Power: 40 |
Probably the easier is use a uniformFixedValue boundary condition, which takes a PatchFunction1 to describe the value. The name 'uniform fixed value' (historical name) is definitely very misleading, since in the meantime it can be also be spatially and temporally varying.
With the PatchFunction1 for the uniformValue, you have a variety of functions available, ranging from constant, table, sin, coded etc. For you, the expression function is probably the most convenient. |
|
April 20, 2023, 07:32 |
|
#3 |
New Member
abdellah
Join Date: Apr 2023
Posts: 2
Rep Power: 0 |
thank you a lot sir, it works, appreciated .
|
|
April 20, 2023, 10:24 |
|
#4 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,695
Rep Power: 40 |
For a nice followup, could you also post your solution. There will inevitably be someone coming in 1-3 years and asking about how you managed to solve it.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Time dependant pressure boundary condition | yosuke1984 | OpenFOAM Verification & Validation | 3 | May 6, 2015 06:16 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 17:44 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 09:56 |
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 | bookie56 | OpenFOAM Installation | 8 | August 13, 2011 04:03 |
Convective Heat Transfer - Heat Exchanger | Mark | CFX | 6 | November 15, 2004 15:55 |