-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdatebuildingMaterials.H
More file actions
57 lines (47 loc) · 1.96 KB
/
Copy pathupdatebuildingMaterials.H
File metadata and controls
57 lines (47 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "buildingMaterialModel.H"
forAll(Materials, MaterialsI)
{
const dictionary& dict = Materials[MaterialsI];
const word cellZoneName(dict.lookup("name"));
const word cellZoneModel(dict.lookup("buildingMaterialModel"));
const scalar rho_(readScalar(dict.lookup("rho")));
const scalar cap_(readScalar(dict.lookup("cap")));
const scalar lambda1_(readScalar(dict.lookup("lambda1")));
const scalar lambda2_(readScalar(dict.lookup("lambda2")));
//create the buildingMaterial model
autoPtr<buildingMaterialModel> buildingMaterial
(
buildingMaterialModel::New("buildingMaterial", dict, cellZoneModel)
);
label cellZoneID = mesh.cellZones().findZoneID(cellZoneName);
if (cellZoneID == -1)
{
Info << "Something is wrong, cannot find at least one of the necessary cellZones! Exiting!" << endl;
Foam::FatalError();
}
const labelList& cells = mesh.cellZones()[cellZoneID];
//const polyBoundaryMesh& patches = mesh.boundaryMesh();
boolList zoneCell(mesh.nCells(), false);
forAll(cells, cellsI)
{
label celli = cells[cellsI];
cellType[celli] = MaterialsI;
zoneCell[celli] = true;
buildingMaterial->update_w_C_cell(pc,ws,Crel,celli);
buildingMaterial->update_Krel_cell(pc,ws,Krel,celli);
rho_m.ref()[celli] = rho_;
cap_m.ref()[celli] = cap_;
lambda_m.ref()[celli] = lambda1_ + lambda2_*ws[celli];
buildingMaterial->update_Kvap_cell(pc,ws,Ts,K_v,K_pt,celli);
}
}
dimensionedScalar minCrel_("minCrel_", dimensionSet(0, -2, 2, 0, 0, 0, 0), minCrel);
Crel = max(Crel, minCrel_);
ws.correctBoundaryConditions();
Crel.correctBoundaryConditions();
Krel.correctBoundaryConditions();
K_v.correctBoundaryConditions();
rho_m.correctBoundaryConditions();
cap_m.correctBoundaryConditions();
lambda_m.correctBoundaryConditions();
K_pt.correctBoundaryConditions();