CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   trying to understand the boundary condition "oscillatingFixedValue" (https://www.cfd-online.com/Forums/openfoam-pre-processing/153602-trying-understand-boundary-condition-oscillatingfixedvalue.html)

hiuluom May 29, 2015 00:20

trying to understand the boundary condition "oscillatingFixedValue"
 
Hi foamer,

I would like to setup oscillatingFixedValue with the equation

u = 2.7 + 16(sėn2pit/16)

I saw the guide at

https://openfoamwiki.net/index.php/M...tingFixedValue

if I understand exactly, the inlet velocity will:
inlet
{
type oscillatingFixedValue;
value uniform 0; // Initialization value
refValue uniform (1 0 0); // Reference value for oscillation
offset (1.7 0 0); // Oscillation mean value offset
amplitude constant 16; // Amplitude of oscillation
frequency constant 0.0625; // frequency
}
Following the equation, I set offset 1.7 will it plus 1 to 2.7?
https://openfoamwiki.net/images/math...6b9cb308f3.png

Thank you
Thanh

hiuluom May 29, 2015 23:38

I ran inlet BCs above no problem with Tjunction tutorial. I only confuse about the "refValue" and "offset":
  1. The offset should be filled 2.7 or 1.7?
  2. If I want to reverse in x-direction, can I only add minus in refValue and offset? Will it exactly become: refValue uniform (-1 0 0); offset (-1.7 0 0)?

hiuluom May 30, 2015 08:05

Does anyone can help me explain my question?

wyldckat May 30, 2015 08:34

Greetings Thanh,

I don't understand what's the doubt you're having? I've checked the source code and the expression on the wiki seems to be correct:
\textrm{\textit{refV}} \cdot \left( 1.0 + \textrm{\textit{Amp}} \cdot \sin \left(2\pi\cdot \textrm{\textit{freq}}\cdot t\right)\right) + \textrm{\textit{offset}}
Therefore, it's a basic mathematical expression. If "refV" is set to 1.0, then you're left with this:
\left( 1.0 +\textrm{\textit{offset}} \right) + \textrm{\textit{Amp}}  \cdot \sin \left(2\pi\cdot \textrm{\textit{freq}}\cdot t\right)
The rest is simple math, namely for having a final offset of 2.7 (with refV =1), you need the "offset" parameter to be 1.7.

And when in doubt, don't be afraid to simulate with OpenFOAM and test things yourself. If you create a simple test case, you can easily test if this works as intended or not. Specifically, if you want to be able to prove that it works as intended, you should in fact do that simple test case first!

Best regards,
Bruno

hiuluom May 30, 2015 12:56

Hi Bruno,

Your explaination is very clearly at refVal. I have simulated with Tjuntion tutorial with inlet Bcs above. I only confuse that offset should be 2.7 or 1.7.

Thank you so much.

hiuluom July 25, 2015 12:45

I add more answer the oscillating. If the equation don't have offset:
Code:

U = 16(sėn2pit/16) (m/s)
So the result will wrong if equation was set follow equation describe above with refV=1, Amp =16, offset =0. Because the equation return

\textrm{\textit{refV}} \cdot \left( 1.0 + \textrm{\textit{Amp}} \cdot \sin \left(2\pi\cdot \textrm{\textit{freq}}\cdot t\right)\right) + \textrm{\textit{offset}}=1\cdot \left( 1.0 + \textrm{\textit{16}} \cdot \sin \left(2\pi\cdot \textrm{\textit{freq}}\cdot t\right)\right)

Code:

U = 1 + 16(sėn2pit/16) (m/s)
Therefore, I think the amplitude always equal to 1. In other hand, refV =16 and offset =-16 as the equation become:

\textrm{\textit{refV}} \cdot \left( 1.0 + \textrm{\textit{Amp}} \cdot \sin \left(2\pi\cdot \textrm{\textit{freq}}\cdot t\right)\right) + \textrm{\textit{offset}}=16\cdot \left( 1.0 + \textrm{\textit{1}} \cdot \sin \left(2\pi\cdot \textrm{\textit{freq}}\cdot t\right)\right) - \textrm{\textit{16}}
Code:

16 +16(sėn2pit/16) - 16 = 16(sėn2pit/16)
That's it.

ssss July 25, 2015 13:12

Use groovyBC for the BC, it is easier

stephie August 17, 2015 03:58

Hello everyone,

I am not sure if this is the right place to asked, but maybe one of you might help me. In my case I have an airfoil in a channel. Now my task is to implement a condition for an oscillating stream. I thought I might use oscillatingFixedValue for it.

I tried for my inlet condition under 0/U:

type oscillatingFixedValue;
refValue (1.56 0 0); //my verlocity
amplitude 0.05;
offset 0;
frequency 0.8;
value uniform (0 0 0)

When I have a look in to the vectorplot I can't see any movement of the vectors, so I think it doesn't work.
Have anyone a hint for me how I can fix my problem?

I would be very gratefule!

Thank you and best regards,
Stephie

wyldckat August 17, 2015 08:17

Quote:

Originally Posted by stephie (Post 559826)
Have anyone a hint for me how I can fix my problem?

Quick answer: Sorry, but you're being too vague in order to give an accurate answer. The best I can say is that you should compare with the plot of the oscillation you're requesting: Plot[0. + 1.56 (1. + 0.05 Sin[2*pi*0.8* t]), {t, 0, 10}]
And/or that perhaps you're not familiar enough yet with the time controls in ParaView?

Beyond this, I suggest:
I say this because you did not specify what settings you have in "controlDict" and if you're solving in transient or steady state.


All times are GMT -4. The time now is 14:07.