Saras
Finite   Difference   Solver   for   Fluid   Dynamics   Simulations
initial.h
Go to the documentation of this file.
1/********************************************************************************************************************************************
2 * Saras
3 *
4 * Copyright (C) 2019, Mahendra K. Verma
5 *
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the copyright holder nor the
16 * names of its contributors may be used to endorse or promote products
17 * derived from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 ********************************************************************************************************************************************
31 */
43#ifndef INITIAL_H
44#define INITIAL_H
45
46#include <blitz/array.h>
47
48#include "vfield.h"
49#include "sfield.h"
50#include "grid.h"
51
52class initial {
53 public:
54 initial(const grid &mesh);
55
56 virtual void initializeField(vfield &uField);
57 virtual void initializeField(vfield &uField, sfield &tField);
58
59 protected:
60 const grid &mesh;
61};
62
71class taylorGreen: public initial {
72 public:
73 taylorGreen(const grid &mesh): initial(mesh) { };
74
75 void initializeField(vfield &uField);
76};
77
86class channelSine: public initial {
87 public:
88 channelSine(const grid &mesh): initial(mesh) { };
89
90 void initializeField(vfield &uField);
91};
92
101class channelRand: public initial {
102 public:
103 channelRand(const grid &mesh);
104
105 void initializeField(vfield &uField);
106};
107
116class zeroInitial: public initial {
117 public:
118 zeroInitial(const grid &mesh): initial(mesh) { };
119
120 void initializeField(vfield &uField) {uField.Vx = 0.0; uField.Vy = 0.0; uField.Vz = 0.0;};
121 void initializeField(vfield &uField, sfield &tField) {uField.Vx = 0.0; uField.Vy = 0.0; uField.Vz = 0.0; tField.F = 0.0;};
122};
123
132#endif
The derived class from initial to impose random initial condition for channel flow.
Definition: initial.h:101
channelRand(const grid &mesh)
Constructor of the initial class.
Definition: channelRand.cc:56
void initializeField(vfield &uField)
Function to impose random initial condition for channel flow on the given input velocity field.
Definition: channelRand.cc:69
The derived class from initial to impose sinusoidal perturbation for channel flow.
Definition: initial.h:86
void initializeField(vfield &uField)
Function to generate sinusoidal perturbation for channel flow.
Definition: channelSine.cc:55
Contains all the global variables related to the grid, its slices, limits, and grid derivatives used ...
Definition: grid.h:53
Contains all the global variables related to the imposing of initial conditions, and functions to imp...
Definition: initial.h:52
initial(const grid &mesh)
Constructor of the initial class.
Definition: initial.cc:54
virtual void initializeField(vfield &uField)
Prototype function to impose the initial conditions on the given field.
Definition: initial.cc:63
Scalar field class to store and operate on scalar fields.
Definition: sfield.h:54
The derived class from initial to impose initial condition of Taylor-Green vortices.
Definition: initial.h:71
void initializeField(vfield &uField)
Function to impose the Taylor Green Vortex initial condition on the given input velocity field.
Definition: taylorGreen.cc:54
Vector field class to store and operate on vector fields.
Definition: vfield.h:54
The derived class from initial to impose the default condition of 0 velocity.
Definition: initial.h:116
void initializeField(vfield &uField)
Prototype function to impose the initial conditions on the given field.
Definition: initial.h:120
void initializeField(vfield &uField, sfield &tField)
Prototype function to impose the initial conditions on the given field.
Definition: initial.h:121
Class declaration of grid.
Class declaration of sfield - scalar field.
Class declaration of vfield - vector field.