ODT
Loading...
Searching...
No Matches
domaincase_odt_isothermalWall.cc
Go to the documentation of this file.
1
7#include "domain.h"
8#include "dv.h"
9#include "dv_pos.h"
10#include "dv_posf.h"
11#include "dv_rho.h"
12#include "dv_dvisc.h"
13#include "dv_uvw.h"
14#include "dv_enth.h"
15#include "dv_temp.h"
16
18
25
26 domn = p_domn;
27
28 domn->v.push_back(new dv_pos( domn, "pos", false, true)); // last are: L_transported, L_output
29 domn->v.push_back(new dv_posf( domn, "posf", false, true));
30 domn->v.push_back(new dv_rho( domn, "rho", false, true));
31 domn->v.push_back(new dv_dvisc(domn, "dvisc", false, false));
32 domn->v.push_back(new dv_temp( domn, "temp", false, true ));
33 domn->v.push_back(new dv_enth( domn, "enth", true, true ));
34 domn->v.push_back(new dv_uvw( domn, "uvel", true, true));
35 domn->v.push_back(new dv_uvw( domn, "vvel", true, true));
36 domn->v.push_back(new dv_uvw( domn, "wvel", true, true));
37
38 int ii = 0;
39 domn->pos = domn->v.at(ii++);
40 domn->posf = domn->v.at(ii++);
41 domn->rho = domn->v.at(ii++);
42 domn->dvisc = domn->v.at(ii++);
43 domn->temp = domn->v.at(ii++);
44 domn->enth = domn->v.at(ii++);
45 domn->uvel = domn->v.at(ii++);
46 domn->vvel = domn->v.at(ii++);
47 domn->wvel = domn->v.at(ii++);
48
49 //------------------- set variables used for mesh adaption
50
51 vector<dv*> phi;
52 phi.push_back(domn->uvel);
53 phi.push_back(domn->temp);
54 domn->mesher->init(domn, phi);
55
56
57 //-------------------- Initialize velocity field to a curve fit of a laminar boundary layer solution
58
59 double nu = domn->pram->kvisc0; // m2/s
60 double vdiff = domn->io->initParams["BL_vdiff"].as<double>();
61 double delta = domn->io->initParams["BL_width"].as<double>();
62
63 double etafac = sqrt(vdiff/nu/delta);
64 double eta;
65 for(int i=0; i<domn->uvel->d.size(); i++) {
66 eta = etafac * domn->pos->d.at(i);
67 if(eta < 7.4)
68 domn->uvel->d[i] = vdiff * (-1.55926E-4*pow(eta,5.0) +
69 3.70924E-3*pow(eta,4.0) -
70 2.84820E-2*pow(eta,3.0) +
71 4.77151E-2*pow(eta,2.0) +
72 3.05872E-1*eta +
73 2.02326E-3 );
74 else
75 domn->uvel->d[i] = vdiff;
76 }
77
78 //------------------- set the gas composition and pressure, which won't change during the sim.
79 // Also set temperature to initialize the enthalpy field.
80 // Hard coding the composition to be air
81
82 int nsp = domn->gas->nSpecies();
83 vector<double> yi(nsp);
84 yi[domn->gas->speciesIndex("O2")] = 0.233;
85 yi[domn->gas->speciesIndex("N2")] = 0.767;
86 domn->gas->setState_TPY(domn->pram->TBChi, domn->pram->pres, &yi.at(0));
87 domn->enth->d = vector<double>(domn->ngrd, domn->gas->enthalpy_mass());
88 domn->temp->d = vector<double>(domn->ngrd, domn->pram->TBChi);
89
90}
91
93
99
100 domn->rho->setVar();
101 domn->dvisc->setVar();
102 domn->temp->setVar();
103
104 domn->enth->LagSrc = false; // reset to false; in enth source the src is computed if false, then set to true on subsequent calls.
105}
106
108
113
114 domn->gas->setState_HP(domn->enth->d.at(ipt), domn->pram->pres, 1.E-10);
115
116}
int ngrd
number of grid cells
Definition domain.h:42
dv * enth
Definition domain.h:57
IdealGasPhase * gas
pointer to cantera thermochemistry object (reaction rates, Cp, etc.)
Definition domain.h:69
dv * uvel
Definition domain.h:51
dv * posf
access as: posf->d[i], or posf->var_name, etc.
Definition domain.h:48
dv * vvel
Definition domain.h:52
dv * wvel
Definition domain.h:53
dv * pos
pointers to gas properties
Definition domain.h:47
meshManager * mesher
pointer to mesh manager object
Definition domain.h:78
inputoutput * io
pointer to input/output object
Definition domain.h:72
dv * dvisc
Definition domain.h:50
vector< dv * > v
All domain variables are stored in here.
Definition domain.h:45
param * pram
pointer to the parameters object
Definition domain.h:73
dv * rho
Definition domain.h:49
dv * temp
Definition domain.h:58
virtual void setGasStateAtPt(const int &ipt)
domain * domn
pointer to domain object (parent)
Definition domaincase.h:28
vector< double > d
the data
Definition dv.h:30
bool LagSrc
flag to lag source term in implicit solve (initially put in for enthalpy radiation)
Definition dv.h:33
virtual void setVar(const int ipt=-1)
Definition dv.h:44
YAML::Node initParams
yaml sub node
Definition inputoutput.h:42
void init(domain *p_domn, const vector< dv * > p_phi)
double TBChi
Required if hWallBCtype = ISOTHERMAL.
Definition param.h:104
double pres
initial pressure (Pa)
Definition param.h:40
double kvisc0
initial uniform kinematic viscosity (m^2/s)
Definition param.h:37
Header file for class domain.
Header file for class domaincase_odt_isothermalWall.
Header file for class dv.
Header file for class dv_dvisc.
Header file for class dv_enth.
Header file for class dv_pos.
Header file for class dv_posf.
Header file for class dv_rho.
Header file for class dv_temp.
Header file for class dv_uvw.