コード例 #1
0
        public InletFlux(BoundaryCondition BC, TableFunction _flux, GetBetaFunction getElasticBeta)
            : base(BC.core_node, BC.current_time)
        {
            this.previous_velocity = 0;

            base_flux_on_time = _flux;
            flux_on_time      = _flux;


            // Artery lumen of terminal and previous nodes are set the same
            core_node.lumen_sq_0 = neighbour_node.lumen_sq_0;
            core_node.lumen_sq   = core_node.lumen_sq_0;


            double R0 = Math.Sqrt(core_node.lumen_sq_0 / Math.PI);


            beta_1        = getElasticBeta(R0, core_node.elasticity) / core_node.lumen_sq_0;
            flux_function = delegate(double A)
            {
                return(A * chrt_back + 4 * Math.Pow(A, 1.25f) * Math.Sqrt(beta_1 / 2.0 / GlobalDefs.BLOOD_DENSITY) - flux_on_time(current_time));
            };

            this.chrt_back = -4 * Math.Pow(core_node.lumen_sq_0, 0.25f) * Math.Sqrt(beta_1 / 2.0f / GlobalDefs.BLOOD_DENSITY);
        }
コード例 #2
0
        public PressureOutletRCR(BoundaryCondition BC, GetBetaFunction getElsticBeta, double _R1, double _R2, double _C)
            : base(BC.core_node, BC.current_time)
        {
            // Windkessel params, R2 is parallel to C //
            R1 = _R1;
            R2 = _R2;
            C  = _C;
            ////////////////////////////////////////////

            //tx_ij - i - time moment, j - space point, 1 - current moment (core node), 0 -previous moment (previus point)/
            U_tx_10 = 0;
            U_tx_01 = 0;
            P_tx_10 = GlobalDefs.DIASTOLIC_PRESSURE;
            P_tx_01 = GlobalDefs.DIASTOLIC_PRESSURE;
            P_tx_11 = GlobalDefs.DIASTOLIC_PRESSURE;
            A_tx_01 = core_node.lumen_sq_0;
            A_tx_10 = core_node.lumen_sq_0;
            Q_t_1   = 0;
            Q_t_0   = 0;
            ///////////////////////////////////////////

            beta_1        = GlobalDefs.getBoileauBeta(core_node.radius, core_node.elasticity) / core_node.lumen_sq_0;
            chrt_function = delegate(double A_tx_11)
            {
                double chrt_frw_right = Q_t_1 / A_tx_11 + 4 * Math.Pow(A_tx_11, 0.25f) * Math.Sqrt(beta_1 / 2.0f / GlobalDefs.BLOOD_DENSITY);
                return(chrt_frw_left - chrt_frw_right);
            };

            DefineSign();
        }
コード例 #3
0
        public void setOutletBC(string parameters)
        {
            List <PressureOutletRCR> oultlet_bc_set = new List <PressureOutletRCR>();

            if (parameters != "")
            {
                List <BC_params> rcr_params = new List <BC_params>();
                IO_Module.LoadBC_RCR_paramsFromString(parameters, out rcr_params);

                foreach (var bc_params in rcr_params)
                {
                    try
                    {
                        int ind = v_net.bounds.FindIndex(x => x.core_node.id == bc_params.id);
                        v_net.bounds[ind] = new PressureOutletRCR(v_net.bounds[ind], GlobalDefs.getBoileauBeta, bc_params.R1, bc_params.R2, bc_params.C);
                        oultlet_bc_set.Add((PressureOutletRCR)v_net.bounds[ind]);
                    }
                    catch { }
                }

                return;
            }

            for (int i = 0; i < v_net.bounds.Count; i++)
            {
                BoundaryCondition bn = v_net.bounds[i];
                bn = new PressureOutletRCR(bn, GlobalDefs.getBoileauBeta, 0.0, 0.0, 0.0);
                oultlet_bc_set.Add((PressureOutletRCR)bn);
            }
        }
コード例 #4
0
        public InletPressure(BoundaryCondition BC, TableFunction _pressure, GetBetaFunction getElasticBeta)
            : base(BC.core_node, BC.current_time)
        {
            pressure_on_time = _pressure;

            double R0 = Math.Sqrt(core_node.lumen_sq_0 / Math.PI);

            beta_1 = getElasticBeta(R0, core_node.elasticity) / core_node.lumen_sq_0;


            core_node.lumen_sq_0 = neighbour_node.lumen_sq_0;
            core_node.lumen_sq   = neighbour_node.lumen_sq_0;

            chrt = 4 * Math.Pow(core_node.lumen_sq_0, 0.25f) * Math.Sqrt(beta_1 / 2.0f / GlobalDefs.BLOOD_DENSITY);
        }
コード例 #5
0
        public WaveTransmissive(BoundaryCondition BC, GetBetaFunction getElsticBeta)
            : base(BC.core_node, BC.current_time)
        {
            //tx_ij - i - time moment, j - space point, 1 - current moment (core node), 0 -previous moment (previus point)/
            Q_tx_10 = 0;
            Q_tx_01 = 0;
            P_tx_10 = GlobalDefs.DIASTOLIC_PRESSURE;
            P_tx_01 = GlobalDefs.DIASTOLIC_PRESSURE;
            P_tx_11 = GlobalDefs.DIASTOLIC_PRESSURE;
            Q_t_1   = 0;
            Q_t_1   = 0;
            ///////////////////////////////////////////

            beta_1 = GlobalDefs.getBoileauBeta(core_node.radius, core_node.elasticity) / core_node.lumen_sq_0;

            chrt_function = delegate(double A_tx_11)
            {
                double chrt_frw_right = Q_t_1 / A_tx_11 + 4 * Math.Pow(A_tx_11, 0.25f) * Math.Sqrt(beta_1 / 2.0f / GlobalDefs.BLOOD_DENSITY);
                return(chrt_frw_left - chrt_frw_right);
            };


            DefineSign();
        }