Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample ds #59

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhistcnt =1
let g:netrw_dirhist_1='/home/openfoam/postProcessing/patchIntegrate(patch=inlet,field=alpha.gas)/0'
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ cd ${0%/*} || exit 1 # Run from this directory
rm -rf 0
cleanCase

#rm *.obj
#rm *.stl

#------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
if [ ! -f qoi.txt ]; then
# Reconstruct if needed
source /projects/gas2fuels/ofoam_cray_mpich/OpenFOAM-dev/etc/bashrc
reconstructPar -newTimes
module load anaconda3/2023
conda activate /projects/gas2fuels/conda_env/bird
python read_history.py -cr .. -cn local -df data
python get_qoi.py
conda deactivate
else
echo "WARNING: QOI already computed"
fi

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ codedSource
type coded;
selectionMode all;
field U.liquid;
//name sourceTime;
name sourceTime;

codeInclude
#{
Expand All @@ -36,30 +36,22 @@ codedSource
const volVectorField& UL =
mesh().lookupObject<volVectorField>("U.liquid");
double pi=3.141592654;
double source_pt_x;
double source_pt_y;
double source_pt_z;
double disk_rad;
double disk_area;
double power;
double smear_factor;
double startTime;
source_pt_x=13.807637692813548;
source_pt_y=1.3807637692813548;
source_pt_z=12.426873923532193;
disk_rad=0.9665346384969483;
disk_area=pi*disk_rad*disk_rad;
power=0;
smear_factor=3.0;
startTime = 1;
double source_pt_x=0.25;
double source_pt_y=0.025;
double source_pt_z=0.225;
double disk_rad=0.017499999999999998;
double disk_area=pi*disk_rad*disk_rad;
double power=2.5;
double smear_factor=3.0;
const scalar startTime = 1;
if (time.value() > startTime)
{
// Get V1
double source_sign_factor = 1.0;
double V1 = 0;
double V2 = 0;
double rhoV;
double dist_tol = disk_rad*3;
double dist_tol = disk_rad*5;

double dist_n;
double upV = 0;
Expand Down Expand Up @@ -134,5 +126,3 @@ codedSource
}
#};
};


Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
T0 300; //initial T(K) which stays constant
VVM 1.6;
//****water Liquid properties**************
CpMixLiq 4181;
muMixLiq #calc "2.414e-5 * pow(10,247.8/($T0 - 140.0))"; //viscosity (Pa.s) of water as a function of T(K)
kThermLiq 0.62; // W/m-K
rho0MixLiq 1000; // kg/m^3
sigmaLiq 0.07; //surface tension N/m
//Wilke-Chang params for diffusion coefficient of a given solute in water (solvent)
WC_psi 2.6;
WC_M 18; // kg/kmol
WC_V_O2 25.6e-3; // m3/kmol molar volume at normal boiling temperature (Treybal 1968)
WC_V_H2 14.3e-3;
WC_V_CO2 34e-3;
WC_V_CO 30.7e-3;
WC_V_N2 31.2e-3;
WC_V_CH4 35e-3; // V_b[cm3/mol]=0.285*V_critical^1.048 (Tyn and Calus; ESTIMATING LIQUID MOLAL VOLUME; Processing, Volume 21, Issue 4, Pages 16 - 17)
//****** diffusion coeff ***********
D_H2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_H2,0.6)";
D_CO2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO2,0.6)";
D_CO #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO,0.6)";
D_CH4 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CH4,0.6)";
D_N2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_N2,0.6)";
//****** Henry coeff ***************
H_O2_298 0.032;
DH_O2 1700;
H_CO2_298 0.83;
DH_CO2 2400;
H_CO_298 0.023;
DH_CO 1300;
H_H2_298 0.019;
DH_H2 500;
H_CH4_298 0.032;
DH_CH4 1900;
H_N2_298 0.015;
DH_N2 1300;
He_H2 #calc "$H_H2_298 * exp($DH_H2 *(1. / $T0 - 1./298.15))";
He_CO #calc "$H_CO_298 * exp($DH_CO *(1. / $T0 - 1./298.15))";
He_CO2 #calc "$H_CO2_298 * exp($DH_CO2 *(1. / $T0 - 1./298.15))";
He_CH4 #calc "$H_CH4_298 * exp($DH_CH4 *(1. / $T0 - 1./298.15))";
He_N2 #calc "$H_N2_298 * exp($DH_N2 *(1. / $T0 - 1./298.15))";
//*******inlet gas frac*************
f_H2 0.1;
f_CO2 0.9;
f_N2 0.0;
//*******inlet gas frac*************
inletA 0.0039;
liqVol 0.003625;
alphaGas 1;
alphaLiq 0;
uGasPhase #calc "$liqVol * $VVM / (60 * $inletA * $alphaGas)";
//*********************************
LeLiqH2 #calc "$kThermLiq / $rho0MixLiq / $D_H2 / $CpMixLiq";
LeLiqCO #calc "$kThermLiq / $rho0MixLiq / $D_CO / $CpMixLiq";
LeLiqCO2 #calc "$kThermLiq / $rho0MixLiq / $D_CO2 / $CpMixLiq"; // = 74
LeLiqCH4 #calc "$kThermLiq / $rho0MixLiq / $D_CH4 / $CpMixLiq";
LeLiqN2 #calc "$kThermLiq / $rho0MixLiq / $D_N2 / $CpMixLiq";
LeLiqMix #calc "$f_CO2*$LeLiqCO2+$f_H2*$LeLiqH2";
PrMixLiq #calc "$CpMixLiq * $muMixLiq / $kThermLiq";
//*********************************
kH2 #calc "$D_H2*$rho0MixLiq*$CpMixLiq*$LeLiqMix";
PrH2 #calc "$muMixLiq*$CpMixLiq / $kH2";

kCO #calc "$D_CO*$rho0MixLiq*$CpMixLiq*$LeLiqMix";
PrCO #calc "$muMixLiq*$CpMixLiq / $kCO";

kCO2 #calc "$D_CO2*$rho0MixLiq*$CpMixLiq*$LeLiqMix";
PrCO2 #calc "$muMixLiq*$CpMixLiq / $kCO2";

kCH4 #calc "$D_CH4*$rho0MixLiq*$CpMixLiq*$LeLiqMix";
PrCH4 #calc "$muMixLiq*$CpMixLiq / $kCH4";

kN2 #calc "$D_N2*$rho0MixLiq*$CpMixLiq*$LeLiqMix";
PrN2 #calc "$muMixLiq*$CpMixLiq / $kN2";
//*********************************
l_scale 0.5;
intensity 0.05;
k_inlet_gas #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)";
k_inlet_liq #calc "1.5 * Foam::pow(($uGasPhase), 2) * Foam::pow($intensity, 2)";
eps_inlet_gas #calc "pow(0.09,0.75) * Foam::pow($k_inlet_gas, 1.5) / ($l_scale * 0.07)";
eps_inlet_liq #calc "pow(0.09,0.75) * Foam::pow($k_inlet_liq, 1.5) / ($l_scale * 0.07)";
omega_inlet_gas #calc "pow(0.09,-0.25) * pow($k_inlet_gas,0.5) / ($l_scale * 0.07)";
omega_inlet_liq #calc "pow(0.09,-0.25) * pow($k_inlet_liq,0.5) / ($l_scale * 0.07)";
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
T0 300; //initial T(K) which stays constant
VVM 0.4;
VVM 0.2;
//****water Liquid properties**************
CpMixLiq 4181;
muMixLiq #calc "2.414e-5 * pow(10,247.8/($T0 - 140.0))"; //viscosity (Pa.s) of water as a function of T(K)
Expand Down Expand Up @@ -42,7 +42,6 @@ He_N2 #calc "$H_N2_298 * exp($DH_N2 *(1. / $T0 - 1./298.15))";
//*******inlet gas frac*************
f_H2 0.1;
f_CO2 0.9;
f_CH4 0.0;
f_N2 0.0;
//*******inlet gas frac*************
inletA ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,62 @@ FoamFile

#include "$FOAM_CASE/constant/globalVars"

type interfaceCompositionPhaseChangeMultiphaseSystem;
type interfaceCompositionPhaseChangePopulationBalanceMultiphaseSystem;

phases (gas liquid);

populationBalances (bubbles);

gas
{
type multiComponentPhaseModel;//pureIsothermalPhaseModel;

diameterModel velocityGroup;

diameterModel constant;

constantCoeffs
velocityGroupCoeffs
{
d 3e-3;
populationBalance bubbles;

shapeModel spherical;

sizeGroups
(
f1 {dSph 1.4e-3; value 0.0;}
f2 {dSph 1.8e-3; value 0.0;}
f3 {dSph 2.2e-3; value 0.0;}
f4 {dSph 2.6e-3; value 0.0;}
f5 {dSph 3e-3; value 1.0;}
f6 {dSph 3.4e-3; value 0.0;}
f7 {dSph 3.8e-3; value 0.0;}
f8 {dSph 4.2e-3; value 0.0;}
f9 {dSph 4.6e-3; value 0.0;}
f10 {dSph 5.0e-3; value 0.0;}
);
}

residualAlpha 1e-6;

Sc 0.7;
}


liquid
{
type reactingPhaseModel;
type multiComponentPhaseModel;//pureIsothermalPhaseModel;

diameterModel constant;

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

residualAlpha 1e-6;
}

Expand Down Expand Up @@ -79,16 +107,7 @@ populationBalanceCoeffs
);

nucleationModels
(
reactionDriven
{
nucleationDiameter 3.0e-3;
velocityGroup gas;
reactingPhase liquid;
dmdtf phaseTransfer:dmidtf;
specie CH4;
}
);
();
}
}

Expand Down Expand Up @@ -141,8 +160,8 @@ drag
(
(gas in liquid)
{
//type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign
type IshiiZuber;
type Grace; // Need to install the model available at https://github.com/NREL/BioReactorDesign
//type IshiiZuber;
residualRe 1e-3;
swarmCorrection
{
Expand Down Expand Up @@ -201,8 +220,8 @@ interfaceComposition.liquid
(liquid and gas)
{
type Henry;
species ( CO2 H2 CH4 );
k ( $He_CO2 $He_H2 $He_CH4 );
species ( CO2 H2 );
k ( $He_CO2 $He_H2 );
Le $LeLiqMix;
}
);
Expand All @@ -214,8 +233,8 @@ diffusiveMassTransfer.liquid
(
(gas in liquid)
{
//type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign
type Frossling;
type Higbie; // Need to install the model available at https://github.com/NREL/BioReactorDesign
//type Frossling;
Le $LeLiqMix;
}

Expand All @@ -227,15 +246,7 @@ diffusiveMassTransfer.liquid
);

phaseTransfer
(
(gas in liquid)
{
type reactionDriven;
reactingPhase liquid;
targetPhase gas;
species (CH4);
}
);
();

lift
(
Expand Down
Loading
Loading