CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

A function of time boundary condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2023, 14:12
Default A function of time boundary condition
  #1
New Member
 
abdellah
Join Date: Apr 2023
Posts: 2
Rep Power: 0
stewie is on a distinguished road
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
stewie is offline   Reply With Quote

Old   April 20, 2023, 03:51
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,695
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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.
olesen is offline   Reply With Quote

Old   April 20, 2023, 07:32
Default
  #3
New Member
 
abdellah
Join Date: Apr 2023
Posts: 2
Rep Power: 0
stewie is on a distinguished road
thank you a lot sir, it works, appreciated .
stewie is offline   Reply With Quote

Old   April 20, 2023, 10:24
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,695
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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.
olesen 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
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


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