Use Generalized boundary condition by Nauman and Mallikarjun 1983

This commit is contained in:
2025-07-01 16:08:35 +02:00
parent f4824b822c
commit e9847607e8

View File

@@ -2,7 +2,7 @@ const ASM3 = require('./asm3_class')
const { create, all } = require('mathjs')
const config = {
matrix: 'Array' // Choose 'Matrix' (default) or 'Array'
matrix: 'Array' // choose 'Matrix' (default) or 'Array'
}
const math = create(all, config)
@@ -185,7 +185,8 @@ class Reactor_PFR {
const BC_gradient = Array(this.n_x).fill(0.0);
BC_gradient[0] = -1;
BC_gradient[1] = 1;
const BC_dispersion = math.multiply(this.alpha*this.D * this.A / (math.sum(this.Fs)*this.d_x), [BC_gradient], new_state)[0];
let Pe = this.length*math.sum(this.Fs)/(this.D*this.A)
const BC_dispersion = math.multiply((1-(1+4*this.volume/math.sum(this.Fs)/Pe)^0.5)/Pe, this.D * this.A / (math.sum(this.Fs)*this.d_x), [BC_gradient], new_state)[0];
console.log(math.add(BC_C_in, BC_dispersion));
new_state[0] = math.add(BC_C_in, BC_dispersion).map(val => val < 0 ? 0 : val);