From e9847607e85d8f6776dae255337dfb04879f753d Mon Sep 17 00:00:00 2001
From: "p.vanderwilt"
Date: Tue, 1 Jul 2025 16:08:35 +0200
Subject: [PATCH] Use Generalized boundary condition by Nauman and Mallikarjun
1983
---
dependencies/reactor_class.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dependencies/reactor_class.js b/dependencies/reactor_class.js
index 2c8d3b8..6dd6168 100644
--- a/dependencies/reactor_class.js
+++ b/dependencies/reactor_class.js
@@ -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);