Pulsed Source Term in OpenFOAM
Hello FOAMers!
I am trying to model a dimensionedScalar source term in a particular region of the mesh, which pulsates with time, i.e. this source term is a square wave which is ON for a period of t1 seconds, and then is OFF for the next t2 seconds, and so on. Let's say I want to simulate "p" pulses of this type. Basically, there is an associated frequency for this source. It also varies in space, but I think I can take care of that part. Could someone let me know how I can go about implementing this periodic (in time) source term? PS - I am a novice at OF development at this point. Thank you in advance! |
I think you can scan the available fvOptions first. If not available, please modify the fvOption closest to your application. Function1 and PatchFunction1 for the time-variant ramp and square functions (and others) are available as well.
https://develop.openfoam.com/Develop...ources/derived https://develop.openfoam.com/Develop...ions/Function1 Hope these can give a useful start for you. |
Thank you @HPE. I'll take a look at these. I was actually able to implement it using a basic if/else structure by defining bool flags for the pulses (ON period) and gaps between pulses (OFF period). But it would be nice to see if I can use/modify some existing fvOptions functionality to do it in a better way.
Thank you! |
All times are GMT -4. The time now is 18:35. |