updateProps.H
Go to the documentation of this file.
1thermo.correct();
2rho=thermo.rho();
3mu=thermo.mu();
4Cp=thermo.Cp();
5alphaP=thermo.alphaP();
6betaT=thermo.betaT();
7enthalpy=thermo.enthalpy();
8// update heat flux
9heatFlux = -kr*fvc::grad(T);
10
11
12// // 1. update internal value
13// {
14// double h;//h: enthalpy
15// double T0,p0;
16// forAll(rho,i)
17// {
18// T0=T[i];p0=p[i];
19// if(p0>MAXP_FREESTEAM || p0<MINP_FREESTEAM)
20// {
21// Info<<"Error in freesteam: valid pressure range in freesteam is [1bar, 1000bar]. But pressure at the "<<i<<"th element is "<<p[i]<<endl;
22// exit(0);
23// }
24// if(T0>MAXT_FREESTEAM)
25// {
26// // Info<<"Error in freesteam: valid temperature range in freesteam is [5C, 800C]. But temperature at the "<<i<<"th element is "<<T[i]<<endl;
27// // Info<<"Debug: set low T to MAXT_FREESTEAM"<<endl;
28// T0=MAXT_FREESTEAM;
29// // exit(0);
30// }
31// if(T0<MINT_FREESTEAM)
32// {
33// // Info<<"Error in freesteam: valid temperature range in freesteam is [5C, 800C]. But temperature at the "<<i<<"th element is "<<T[i]<<endl;
34// // Info<<"Debug: set low T to MINT_FREESTEAM"<<endl;
35// T0=MINT_FREESTEAM;
36// // exit(0);
37// }
38// // Info<<"pressure: "<<p[i]<<" Temperature: "<<T[i]<<endl;
39// SteamState S = freesteam_set_pT(p0, T0);
40// // rho[i]=freesteam_rho(S);
41// // mu[i]=freesteam_mu(S);
42// // cp_f[i]=freesteam_cp(S);
43// calculateProperties_h(S,h,rho[i],mu[i],betaT[i],alphaP[i],Cp[i]);
44// // calculateDlnRho_DlnT(p0,T0,dLnRho_dLnT[i]);
45// }
46// // 2. update boundary value
47// forAll(rho.boundaryField(), patchI)
48// {
49// forAll(rho.boundaryField()[patchI], faceI)
50// {
51// p0=p.boundaryField()[patchI][faceI];
52// T0=T.boundaryField()[patchI][faceI];
53// if(p0>MAXP_FREESTEAM || p0<MINP_FREESTEAM)
54// {
55// Info<<"Error in freesteam: valid pressure range in freesteam is [1bar, 1000bar]. But pressure at the "<<faceI<<"th face of the "<<patchI<<"th patch is "<<p0<<endl;
56// exit(0);
57// }
58// if(T0>MAXT_FREESTEAM)
59// {
60// Info<<"Error in freesteam: valid temperature range in freesteam is [5C, 800C]. But temperature at the "<<faceI<<"th face of the "<<patchI<<"th patch is "<<T0<<endl;
61// Info<<"Debug: set low T to MAXT_FREESTEAM"<<endl;
62// T0=MAXT_FREESTEAM;
63// // exit(0);
64// }
65// if(T0<MINT_FREESTEAM)
66// {
67// Info<<"Error in freesteam: valid temperature range in freesteam is [5C, 800C]. But temperature at the "<<faceI<<"th face of the "<<patchI<<"th patch is "<<T0<<endl;
68// Info<<"Debug: set low T to MINT_FREESTEAM"<<endl;
69// T0=MINT_FREESTEAM;
70// // exit(0);
71// }
72// // Info<<"boundary pressure: "<<p0<<" Temperature: "<<T0<<endl;
73
74// SteamState S = freesteam_set_pT(p0, T0);
75// // rho.boundaryFieldRef()[patchI][faceI]=freesteam_rho(S);
76// // mu.boundaryFieldRef()[patchI][faceI]=freesteam_mu(S);
77// // cp_f.boundaryFieldRef()[patchI][faceI]=freesteam_cp(S);
78// calculateProperties_h(S,h,rho.boundaryFieldRef()[patchI][faceI],
79// mu.boundaryFieldRef()[patchI][faceI],
80// betaT.boundaryFieldRef()[patchI][faceI],
81// alphaP.boundaryFieldRef()[patchI][faceI],
82// Cp.boundaryFieldRef()[patchI][faceI]);
83// // calculateDlnRho_DlnT(p0,T0,dLnRho_dLnT.boundaryFieldRef()[patchI][faceI]);
84// }
85// }
86
87
88// }
89// // thermo.correct(); //update thermo
90// // // Info<<"test thermo: "<<thermo.rho()<<endl;
91// // // Info<<"write cp_f: "<<rho<<endl;
92// // rho=thermo.rho();
93// // cp_f=thermo.Cp();
94// // mu=thermo.mu()*0.7;
95// // beta_f=beta_f*300;
96// // mu=mu*0.9;
dimensionedScalar kr
Definition: createFields.H:48
hydroThermo & thermo
Definition: createFields.H:4
volScalarField & T
Definition: createFields.H:12
mu
Definition: updateProps.H:3
enthalpy
Definition: updateProps.H:7
alphaP
Definition: updateProps.H:5
betaT
Definition: updateProps.H:6
rho
Definition: updateProps.H:2
heatFlux
Definition: updateProps.H:9
Cp
Definition: updateProps.H:4