Difference between revisions of "Main ContribExamples/OscillatingFixedValue"

From OpenFOAMWiki
(New page: Searching the tutorials I couldn't find an example of how to use this type of boundary condition, so I've created a very small and simple tutorial. Basically, the setup requires the defini...)
 
 
(3 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
         refValue        uniform (1 0 0);
 
         refValue        uniform (1 0 0);
 
     }
 
     }
The above setup enables to specify a boundary condition for an entire patch that varies in time as:
+
The above setup enables to specify a velocity boundary condition for an entire patch that varies in time as:
  
 
     <math>1+amplitude\cdot\sin\left(2\pi\cdot frequency\cdot t\right)</math>
 
     <math>1+amplitude\cdot\sin\left(2\pi\cdot frequency\cdot t\right)</math>
Line 14: Line 14:
  
 
[[Media:bcOscilating.tar.gz|Sample OpenFOAM case]] - it applies to {{VersionInfo}}{{Version1.5}}
 
[[Media:bcOscilating.tar.gz|Sample OpenFOAM case]] - it applies to {{VersionInfo}}{{Version1.5}}
 +
 +
 +
----
 +
Update  - it applies to {{VersionInfo}}{{Version2.1}}
 +
 +
As from OpenFOAM 2.1.x, the dictionary for this boundary condition should read as
 +
    myPatch
 +
    {
 +
        type          oscillatingFixedValue;
 +
        value        uniform 0;    // Initialization value
 +
        refValue      uniform ''refV'';    // Reference value for oscillation
 +
        offset        ''offset'';          // Oscillation mean value offset
 +
        amplitude      constant ''Amp''; // Amplitude of oscillation
 +
        frequency      constant ''freq''; // frequency
 +
    }
 +
for a given scalar field.  If applied to vector field, value, offset and refValue should be modified accordingly.  This dictionary specifies an oscillating boundary condition of a given scalar, for an entire patch, as:
 +
 +
    <math> \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}}</math>
 +
----

Latest revision as of 23:57, 28 January 2013

Searching the tutorials I couldn't find an example of how to use this type of boundary condition, so I've created a very small and simple tutorial. Basically, the setup requires the definition of 4 parameters:

   inlet
   {
       type oscillatingFixedValue;
       amplitude       0.5;
       frequency       0.2;
       refValue        uniform (1 0 0);
   }

The above setup enables to specify a velocity boundary condition for an entire patch that varies in time as:

   1+amplitude\cdot\sin\left(2\pi\cdot frequency\cdot t\right)

Unsteady Velocity Field

Sample OpenFOAM case - it applies to Valid versions: OF version 15.png



Update - it applies to Valid versions: OF Version 21.png

As from OpenFOAM 2.1.x, the dictionary for this boundary condition should read as

   myPatch
   {
       type          oscillatingFixedValue;
       value         uniform 0;    // Initialization value
       refValue      uniform refV;    // Reference value for oscillation
       offset        offset;           // Oscillation mean value offset
       amplitude      constant Amp; // Amplitude of oscillation
       frequency      constant freq; // frequency
   }

for a given scalar field. If applied to vector field, value, offset and refValue should be modified accordingly. This dictionary specifies an oscillating boundary condition of a given scalar, for an entire patch, as:

    \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}}