Contrib/perturbU

From OpenFOAMWiki

1 Introduction

Source code repository
perturbU at GitHub
Description
A few utilities for initializing fields for LES simulations for OpenFOAM.
These utilities were created by Eugene de Villiers and are related to his PhD Thesis "The Potential of Large Eddy Simulation for the Modeling of Wall Bounded Flows", available here: FOAM CFD: PhD Students, Theses and Research at FOAMCFD.org
The repository perturbU at GitHub has been created by Bruno Santos (wyldckat) to assist in maintaining an easier way to keep updating the code to be usable with the latest OpenFOAM versions.
Original sources for these utilities:
Support pages

2 Installation

Valid versions: OF version 17.png OF Version 20.png OF Version 21.png OF Version 22.png OF Version 23.png OF Version 24.png OF Version 30.png OF Version 40.png OF Version 4x.png

The installation depends on the way you download the source code:

2.1 Using Git

  1. Go to your user folder:
    mkdir -p $FOAM_RUN
    cd $FOAM_RUN/..
  2. Clone the repository and go into the cloned repository:
    git clone https://github.com/wyldckat/perturbU.git
    cd perturbU
  3. Checkout the repository respective to the version of OpenFOAM you are using:
    • OpenFOAM 4.0 and newer:
    git checkout OF4x
    • OpenFOAM 3.0 to 3.0.x:
    git checkout OF30x
    • OpenFOAM 2.0 to 2.4:
    git checkout OF20x
    • OpenFOAM 1.7 and older:
    git checkout OF17x
  4. Build perturbU* utilities by running:
    wmake all

2.2 Using Zip

  1. Go to your user folder:
    mkdir -p $FOAM_RUN
    cd $FOAM_RUN/..
  2. Get the Zip file for the repository respective to the version of OpenFOAM you are using:
    • OpenFOAM 4.0 and newer:
    wget https://github.com/wyldckat/perturbU/archive/OF40x.zip -O perturbU.zip
    • OpenFOAM 3.0 to 3.0.x:
    wget https://github.com/wyldckat/perturbU/archive/OF30x.zip -O perturbU.zip
    • OpenFOAM 2.0 to 2.4:
    wget https://github.com/wyldckat/perturbU/archive/OF20x.zip -O perturbU.zip
    • OpenFOAM 1.7 and older:
    wget https://github.com/wyldckat/perturbU/archive/OF17x.zip -O perturbU.zip
  3. Unzip the respective file and go into the respective folder, for example:
    unzip perturbU.zip
    mv perturbU-OF20x perturbU
    cd perturbU
  4. Build perturbU* utilities by running:
    wmake all

3 Usage

  1. Assuming you've already followed the instructions given in the section Installation, then copy the file perturbUChannel/perturbUDict to your case folder's system sub-folder. For example, from within your case folder, run:
    cp $FOAM_RUN/perturbU/perturbUChannel/perturbUDict system/
  2. Edit the file perturbUChannel/perturbUDict and adjust to your needs.
  3. Run the respective utility for your situation:
    • For channel simulations:
      perturbUChannel
    • For cylinder simulations:
      perturbUCylinder
    • In theory, this should work for any simulation:
      perturbUGeneric


3.1 Usage Notes

3.1.1 Getting a turbulent field in steady-state

Source: PerturbU - post #26 Quoting from the post:

The default perturbUDict has the bulk velocity set to false. As Eugene mentions in his thesis this would lead to damping the perturbations, to get a turbulent field in steady state set it back to true.


3.1.2 Problems with transportProperties file

Valid versions: OF Version 30.png

Source: PerturbU - post #26

perturbUChannel complains about not being able to read the file constant/transportProperties. Therefore, try changing from something like this:

Ubar [0 1 -1 0 0 0 0] (0.1335 0 0);

transportModel Newtonian;

nu [0 2 -1 0 0 0 0] 2e-05;

to this:

Ubar Ubar [0 1 -1 0 0 0 0] (0.1335 0 0);

transportModel Newtonian;

nu nu [0 2 -1 0 0 0 0] 2e-05; 

4 Threads on how to use or simply refer to perturbU