Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
BSplines/ControlPoints.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
50 lines (40 sloc)
1.09 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Generate control points for the spline reconstruction of the fluid EoS | |
%% Ideal Gas equation in vapor state | |
%% Tait Equation in liquid state | |
%% Saikat Mukherjee Purdue University September 27 2022 | |
clear all; | |
close all; | |
R = 461.5; | |
K0 = 2.15*10^9; | |
n = 7.15; | |
P0 = 101325; | |
rho0 = 1000; | |
theta = 300; | |
rho_l = 996.5; | |
rho_v = 0.0256; | |
DeltaP = 10000.0; | |
%% Control Point 1 : Ideal Gas Equation | |
rho1 = rho_v; | |
p1 = rho_v*R*theta; | |
%% Control Point 6 : Tait EoS | |
rho6 = rho_l; | |
p6 = K0/n*( (rho_l/rho0)^n-1 ) + P0; | |
%% Control Point 2 : Match the slope from the ideal gas equation | |
rho2 = rho1 + DeltaP/(R*theta); | |
p2 = p1 + DeltaP; | |
%% Control Point 5 : Match the slope from Tait EoS | |
rho5 = rho6 - DeltaP/(K0/rho0^n*rho_l^(n-1)); | |
p5 = p6 - DeltaP; | |
%% Control Point 3 | |
rho3 = 0.25*(rho_l+3*rho_v); | |
p3 = p2; | |
%% Control Point 4 | |
rho4 = 0.25*(rho_v+3*rho_l); | |
p4 = p5; | |
t = [0 0 0 1 2 3 4 4 4]; | |
bspline(t) | |
% x = [ rho1 rho2 rho3 rho4 rho5 rho6 ]; | |
% y = [ p1 p2 p3 p4 p5 p6 ]; | |
% xx = rho1:0.01:rho6; | |
% yy = spline(x,y,xx); | |
% plot(x,y,'o',xx,yy); |