 11 Aug, 2020 1 commit


James Sutherland authored
Plug Flow Reactor Modification See merge request !30

 10 Aug, 2020 2 commits


Hang Zhou authored
Do not need to save mole fractions of all species by default (mass fractions have been saved by default).

Hang Zhou authored
Modifying the method to get mole fraction of the last species for initial/inflow condiitons when species fractions are set based on database. When species fractions are given in the input file, `pokitt::ERRORSPECN` is used (error is given when getting fraction of the last species to be negative or bigger than one.) When species fractions are given based on the database, `pokitt::CLIPSPECN' is used. (For the fraction of the last species, it is set to be `1` when value bigger than one is obtained, and is set to be `0` when negative value is obtained.). In this way, we need to be careful when writing the database to make sure the sum of the first (n1) species fractions is equal or less than 1.

 04 Aug, 2020 1 commit


Hang Zhou authored
Adding the function which allows setting initial or inflow conditions based on database coresponding to the grid value. For example, when we have various surrounding temperatures for heat transfer, and want to have various inflow temperatures for each surrouding temperature, we can read the values for temperature from the database, like 'Data.txt'. We can give it by `InitialConditions: {value: FromDatabase variable:T}'and 'InitialInflowData: {FileName:Data.txt}' in the input file. Also, if we want to set species mole fractions based on database as well, we can give it by `InitialInflowData: {InitialSpeciesSetting: FromDataBase}' or 'InitialInflowData: {InflowSpeciesSetting: FromDataBase}', instead of specifying species in `InitialConditions` or 'InflowConditions'. (The default for `InitialSpeciesSetting` and `InflowSpeciesSetting` is `FromInputFile`. For this, species fractions need to be given in `InitialConditiobs' or 'InflowConditions' in the input file. Fractions of species not specified in the input file or the database are set to be zero.)

 30 Jul, 2020 1 commit


Hang Zhou authored
When checking if a speices name read from input file (for example, 'X_O2' and 'Y_O2', or 'X_O2_inflow' and 'Y_O2_inflow') is inflow condition, we need to check if the last seven terms of the name are `_inflow`. (if name.substr(name.size()7)=="_inflow"). However, the mininum size of name is three, liek `X_H`. Checking the last seven terms will give error when the size of name is less than seven. So, I just check if the last three terms are 'low'.

 23 Jul, 2020 2 commits


Hang Zhou authored
Calculating number of particles per volume, instead of total number of particles in the reactor. The latter depends on the reactor volume. What we care about is the particle loading (number of particles per volume).

Hang Zhou authored
Adding functions for plug flow reactor, so plug flow reactor can be simulated. The reactor type can be given by `ReactorParameters: ReactorType: ` in the input file. Now, three types are supported: `PSRConstangVolume`, 'PSRConstantPressure` and 'PFR`. No default reactor type is set in the code, which must be given in the input file.

 17 Jun, 2020 1 commit


Hang Zhou authored
Deleting the weight functions used to calculate the source terms in CPD models. Because the source term is releated to the mass of labile bridge and delta, it will become zero when the mass is zero. And the source terms are set to be zero if mass is negative. So, it will not oscillate around zero like what we have for vaporization model, that is, weight function is not required.

 27 May, 2020 1 commit


Hang Zhou authored
Adding an option to specify reactor shape. Now, spherical and cylinder are supported, which can be given in the input file by `ReactorParameters: {ReactorShape:}'. Radius needs to be given for both types of reactor (default: 0.001). Height needs to be given for cylinder reactor (default: 0.0).

 26 May, 2020 1 commit


Hang Zhou authored
Modifying the method to set initial/inflow values of coal particle loading, CPD parameters (l, delta_i and g_i), and tar and soot mass. They can be given in the input file by `Particles: {ParticleLoading: ParticleLoadingInflow: }`, `Particles:{CPDInflow:{l: deltai: gi:} CPDInit:{l: deltai: gi:}}`, and `Particles:{TarSootInflowFrac: TarSootInitFrac:}`, respectively. If they are not given in the input file, they will be set based on the equivalence ratio and coal composition.

 19 May, 2020 3 commits


Hang Zhou authored
Adding coal type `Given_From_Input_File` into char models. Modifying the coal type name used in interpolation to get CPD parameters, whose format should be camelcase.

James Sutherland authored
Add a coal type named `Given_From_InputFile` See merge request !29

Hang Zhou authored
Modifying the format of coal type name given in the input file, which mixes camelcase with underscores before, such as `NorthDakota_Lignite`. Camelcase is used now, such as 'NorthDakotaLignite'.

 15 May, 2020 1 commit


Hang Zhou authored
Add a coal type named `Given_From_InputFile`, which ultimate and proximate analysis are given in the input file by "CoalComposiiton: UltimateAnalysis: {C: H: O: N: S:} ProximateAnalysis:{Moisture: Ash: Volatile: FixedC:}. Also, its CPD data is interpolated based on the CPD data of six exist coal types.

 11 May, 2020 2 commits


James Sutherland authored
Cpd cv fix See merge request !28

Hang Zhou authored
Changing the method to give heat transfer coefficient and surrounding temperature in the input file. Instead of using `HeatTransferParameter: value: variable:`, `HeatTransferParameter: HeatTransferCoefficient:' and 'HeatTransferParameter: SurroundingsTemperature:' are used. In this case, tag names of `heat_transfer_coefficient` and `surroundings_temperature` are hard coded and could not be changed in the input file.

 05 May, 2020 2 commits


Hang Zhou authored

Hang Zhou authored
Modifying the mixing term in Jacobian matrix for gas phase under constant volume condition. Giving `dmixGasdU=1/tau` and substracting this from the matrix. Because mixing term in Jacobian matrix for particle phase is given by `dmixPartdV * dVdU`, which is different from `dmixGasdU` and coudld not be given using `Expr::matrix::ScaledIdentityMatrix<FieldT>::SCALEDIVIDE` * 'Expr::matrix::PermutationSubMatrix` for all solved variables, including gas and particle phase variables.

 28 Apr, 2020 4 commits


Hang Zhou authored
Modifying reaction rate of `C`, `Delta_i`, `G_i` and `l`. Using weight function as we did in vaporization rate for these reactions rates to avoid getting negative mass for these components.

Hang Zhou authored
2. Clear up the code setting the initial/inflow masses of coal particle, moisture, volatile and char, and labile bridge(l) and delta in CPD model. 3. Modifying the mistake of index of `delta_i` and `g_i` tags and the mistake in sensitivity of `E_fun.h`.

Hang Zhou authored
Modifying the mixing term in Jacobian matrix for particle equations, `dmixingPartdV`. The mixing term in particle temperature equation depends on particle mass fraction per gas mass. Therefore, `dmixingPartdV` should include term `dmixingPartdYp` (Yp is the particle mass fraction per gas mass). It is not only for coal particles, and should be included for all types of particles.

Hang Zhou authored
Deleting the unused file 'src/particles/ParticleNumFraction.h`. Particle loading is directly given in the input file, instead of being calculated using number of particle, density of gas phase and reactor size.

 15 Apr, 2020 1 commit


Hang Zhou authored
1. Modifying the tag name for heat tranfer coefficient and surroundings temperature for calculating heat transfer between gas and surrounding: Using lower case with words separated by underscores, instead of upper case. 2. Modifying the input files for test in `rtest` directory based on the new method giving heat transfer parameters between gas and surroundings.

 10 Apr, 2020 4 commits


James Sutherland authored
Update steady_cv_ad_closed__Tpzvar.yaml. Closes #17 See merge request !26

Hang Zhou authored
Update steady_cv_ad_closed__Tpzvar.yaml. It takes too long to reach the desired tolerance 1e12. The tolerance is reduced to 1e9, which is adequate for what we are interested in.

James Sutherland authored
Adding Devolatilization and Char model into Zodiac See merge request !25

Hang Zhou authored
For coal partilce (ParticleType: Coal), `ParticleLoading` and `ParticleLoadingInflow` are not needed, which are calculated based on the desired fuelair equivalence ratio, gas species mass fractions and coal particle composition.

 08 Apr, 2020 1 commit


Hang Zhou authored
Changing the method to give particle loading for solid or liquid particles. Instead of giving the number of particles, particle loading (number of particles per gas mass) need to b e given in the input file. For `UserDefinedList` partiticle distribution, instead of giving `Numbers`, `NumbersFraction` is given in the input file.

 06 Apr, 2020 2 commits


Hang Zhou authored

Hang Zhou authored
1. Modifying the heat transfer from tar and soot reaction to gas phase. The oxidation heat of tar and soot should be added into the heat transfer term, which also includes the heat transfer from gas transportation. 2. Modifying the mistake in soot oxidation rate about preexponential factor. Its value is given based on unit of `atm` for pressure. It should be changed to `Pa`.

 05 Apr, 2020 3 commits


Hang Zhou authored
Modifying `EigenvalueModifier.h`. Calculating the explosive eigenvalue using the fullRHS matrix for both constant volume and pressure reactors, instead of using kinetic and heat RHS terms `dkindU+dqdV` to get explosive eigenvalue and substract `1/tau` from it for constant volume reactor. In this way, same Eigenvalue modifier could be used for constant volume and pressure reactors.

Hang Zhou authored
1. Modifying the mixing term in particle temperature equation for solid and liquid particles. In previous version, mass of particle per gas mass is the same as the inflow mass of particle per gas mass, which should not be assumed. 2. Modifying the weight function for vaporization rate function to help convergence for liquid particle.

Hang Zhou authored
Changing the way giving `HeatTransferCoefficient` and `SurroundingsTemperature` for heat transfer between gas and surroungings in the input file. Now, it is given by `ReactorParameters: HeatTransferParameter: value variable`, instead of giving them seperately by `ReactorParameters: HeatTransferCoefficient:vaule variable:HeatTransferCoefficient SurroundingsTemperature:value variable:SurroundingsTemperature.`. Also, the default values are set to be 0 for `HeatTransferCoefficient` and 300 for `SurroundingsTemperature`. Now, both of heat transfer coefficient and surroundings temperature must be given or not given in "HeatTransferParameter" simultaneously.

 04 Apr, 2020 3 commits
 31 Mar, 2020 4 commits


James Sutherland authored
# Conflicts: # rtests/run_test.cmake

Hang Zhou authored
Modifying the method to rename the database when restart. Insteading of adding a suffix into the dababase name, we could just change its prefix, which is given in the input file `Output:output_prefix` (default: database). In the input file, we have `restart:restart_prefix` to rename the database. If it is not given or it is the same as `Output:output_prefix`, the database will be overwritted. If not, a new dabatase with the new name based on `restart:restart_prefix` will be writen.

Hang Zhou authored
Changing the filed type in Zodiac from `SVolField` to `VertexField`, so that the grid variable will includes the maximum and minimum values given in the input field. If using `SVolField`, finite volume method will be used to get grid. So grid list will be [min+spacing/2, ......, maxspacing/2], which is not convenient.

Hang Zhou authored
1. Modifying the source terms for $\delta_i$ and $g_i$ in CPD model. When calculating the massbased source term for $\delta_i$ and $g_i$ from mass reaction rate of labile bridge $\ell$, we need $\frac{d\ell}{dt}\frac{\nu Mw_g}{Mw_\ell}\frac{fg_i}{\sum fg_i}$. Here, $\nu$ is the stoichiometric coefficient of $\delta$ or $g$ in the CPD reaction. $Mw_g$ is the molecular weight of the mixture of all 16 $g_i$, including all light gas species and tar.(We use molecular weight of each species $Mw_{g_i}$, instead of $Mw_g$, in previous code, which is not correct). $Mw_\ell$ is the molecular weight of labile bridge $\ell$. $\frac{fg_i}{\sum fg_i}$ is the mass fraction of species $i$ in $g$. More details could be found in the documents in file `/src/particles/coal/Devolatilization/CPD/Gi_RHS.h` and `/src/particles/coal/Devolatilization/CPD/Deltai_RHS.h`. 2. For gas tar production rate (tar in particel `tarPart` reaction rate), we use the infomarion of labile bridge, including its mass and reaction rate, which could be found in previos version of Zodiac `cd1c42a9`, /src/particles/coal/Devolatilization/CPD/TarProductionRate.h. This method always leads to smaller particle mass than we expect. Because `tarPart` and `l` have different initial masses and reaction rates. When `tarPart` mass reduces to zero and `l` mass is still positive, we will still have negative `tarPart` reaction rate using `l` mass and `l` reaction. And this negative reaction rate will results in negative `tarPart` mass and more mass loss for each coal particle. To solve this, gas tar production rate is calculated using the same method as the light gas species using derived equations directly from CPD model reaction path. So, instead of solving equation for `tarPart`, we solve `delta15` and `g15` now. Also, we could use previous method in `TarProductionRate.h` by forcing the `tarPart` reaction rate to be zero when `tarPart` mass is zero or negative. In this version, we choose the first method now.
