Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions applications/compute_kla_uq.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import argparse
import os

import numpy as np

from bird import BIRD_KLA_DATA_DIR
from bird.postprocess.kla_utils import compute_kla, print_res_dict

Expand Down Expand Up @@ -55,10 +57,13 @@
else:
bootstrap = True

data = np.loadtxt(args.data_file)
data_t = data[:, args.time_index]
data_c = data[:, args.conc_index]

res_dict = compute_kla(
filename=args.data_file,
time_ind=args.time_index,
conc_ind=args.conc_index,
data_t,
data_c,
bootstrap=bootstrap,
max_chop=args.max_chop,
)
Expand Down
15 changes: 6 additions & 9 deletions bird/postprocess/computeQoI/compute_QOI.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,50 +115,47 @@ def get_var(case_folder, time_folder, cell_centers, nCells, val_dict, name):
case_folder,
time_folder,
nCells,
spec_name="CO2",
species_name="CO2",
field_dict=val_dict,
)
elif name.lower() == "co_liq":
var, val_dict = compute_ave_y_liq(
case_folder,
time_folder,
nCells,
spec_name="CO",
species_name="CO",
field_dict=val_dict,
)
elif name.lower() == "h2_liq":
var, val_dict = compute_ave_y_liq(
case_folder,
time_folder,
nCells,
spec_name="H2",
species_name="H2",
field_dict=val_dict,
)
elif name.lower() == "c_co2_liq":
var, val_dict = compute_ave_conc_liq(
case_folder,
time_folder,
nCells,
spec_name="CO2",
mol_weight=44.00995 * 1e-3,
species_name="CO2",
field_dict=val_dict,
)
elif name.lower() == "c_co_liq":
var, val_dict = compute_ave_conc_liq(
case_folder,
time_folder,
nCells,
spec_name="CO",
mol_weight=28.01055 * 1e-3,
species_name="CO",
field_dict=val_dict,
)
elif name.lower() == "c_h2_liq":
var, val_dict = compute_ave_conc_liq(
case_folder,
time_folder,
nCells,
spec_name="H2",
mol_weight=2.01594 * 1e-3,
species_name="H2",
field_dict=val_dict,
)
else:
Expand Down
1 change: 1 addition & 0 deletions bird/postprocess/data_conditional_mean/constant/globalVars
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ He_CO2 0.64;
Mw_CO2 0.044;//kg/mol
Mw_CO 0.028;
Mw_H2 0.002;
Mw_H2O 0.018;
//****Liquid properties**************
CpMixLiq 4181;
muMixLiq 0.001; // 1 cP
Expand Down
303 changes: 303 additions & 0 deletions bird/postprocess/data_conditional_mean/constant/phaseProperties
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object phaseProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "$FOAM_CASE/constant/globalVars"

//type populationBalanceMultiphaseSystem;

type interfaceCompositionPhaseChangePopulationBalanceMultiphaseSystem;

phases (gas liquid);

populationBalances (bubbles);

gas
{
type multiComponentPhaseModel;//pureIsothermalPhaseModel;

diameterModel velocityGroup;

velocityGroupCoeffs
{
populationBalance bubbles;

shapeModel spherical;

sizeGroups
(
f1 {dSph 1e-3; value 0.0;}
f2 {dSph 1.5e-3; value 0.0;}
f3 {dSph 2e-3; value 1.0;}
f4 {dSph 2.5e-3; value 0.0;}
f5 {dSph 3e-3; value 0.0;}
f6 {dSph 3.5e-3; value 0.0;}
f7 {dSph 4e-3; value 0.0;}
f8 {dSph 4.5e-3; value 0.0;}
f9 {dSph 5e-3; value 0.0;}
f10 {dSph 5.5e-3; value 0.0;}
f11 {dSph 6e-3; value 0.0;}
f12 {dSph 6.5e-3; value 0.0;}
f13 {dSph 7e-3; value 0.0;}
f14 {dSph 7.5e-3; value 0.0;}
f15 {dSph 8e-3; value 0.0;}
f16 {dSph 8.5e-3; value 0.0;}
f17 {dSph 9e-3; value 0.0;}
f18 {dSph 9.5e-3; value 0.0;}
f19 {dSph 10e-3; value 0.0;}
f20 {dSph 10.5e-3; value 0.0;}
f21 {dSph 11e-3; value 0.0;}
);
}

residualAlpha 1e-6;
}

liquid
{
type multiComponentPhaseModel;//pureIsothermalPhaseModel;

diameterModel constant;

constantCoeffs
{
d 1e-4;
}
Sc #codeStream
{
code
#{
os << ($LeLiqMix * $CpMixLiq * $muMixLiq / $kThermLiq);
#};
};

residualAlpha 1e-6;
}

populationBalanceCoeffs
{
bubbles
{
continuousPhase liquid;

coalescenceModels
(
LehrMilliesMewes{
uCrit 0.08;
alphaMax 0.6;
}
);

binaryBreakupModels
(
// LehrMilliesMewes{}
);

breakupModels
(
Laakkonen{
daughterSizeDistributionModel Laakkonen;
}
);

driftModels
(
densityChange{}
);

nucleationModels
();
}
}

blending
{
default
{
type linear;
minFullyContinuousAlpha.gas 0.7;
minPartlyContinuousAlpha.gas 0.3;
minFullyContinuousAlpha.liquid 0.7;
minPartlyContinuousAlpha.liquid 0.3;
}
heatTransfer
{
type linear;
minFullyContinuousAlpha.gas 1;
minPartlyContinuousAlpha.gas 0;
minFullyContinuousAlpha.liquid 1;
minPartlyContinuousAlpha.liquid 0;
}
massTransfer
{
$heatTransfer;
}
}

surfaceTension
(
(gas and liquid)
{
type constant;
sigma $sigmaLiq;
}
);

interfaceCompression
();

aspectRatio
(
(gas in liquid)
{
type Wellek;
}
);

drag
(
(gas in liquid)
{
type IshiiZuber;

residualRe 1e-3;
swarmCorrection
{
type none;
}
}
);

virtualMass
(
(gas in liquid)
{
type constantCoefficient;
Cvm 0.5;
}
);

// heatTransfer
// ();

heatTransfer.gas
(
(gas in liquid)
{
type spherical;
residualAlpha 1e-4;
}

(liquid in gas)
{
type RanzMarshall;
residualAlpha 1e-4;
}
);

heatTransfer.liquid
(
(gas in liquid)
{
type RanzMarshall;
residualAlpha 1e-4;
}

(liquid in gas)
{
type spherical;
residualAlpha 1e-4;
}
);

interfaceComposition.gas
();

interfaceComposition.liquid
(
(liquid and gas)
{
type Henry;
species ( CO2 CO H2);
k ( 6.4e-1 2.0e-2 1.8e-2);
Le $LeLiqMix;
}
);

diffusiveMassTransfer.gas
();

diffusiveMassTransfer.liquid
(
(gas in liquid)
{
type Higbie;
Le $LeLiqMix;
}

(liquid in gas)
{
type spherical;
Le 1.0; //not used for spherical
}
);

phaseTransfer
();

lift
(
(gas in liquid)
{
type wallDamped;

wallDamping
{
type cosine;
Cd 3.0;
}

lift
{
type Tomiyama;

swarmCorrection
{
type none;
}
}
}

);

wallLubrication
(
(gas in liquid)
{
type Antal;
Cw1 -0.01;
Cw2 0.05;
}
);

turbulentDispersion
(
(gas in liquid)
{
type Burns;
sigma 0.9;
}
);

// ************************************************************************* //
Loading
Loading