Skip to content

Commit

Permalink
円形鋼管の断面性能計算を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
st-func committed Feb 15, 2024
1 parent b32259c commit fd50e04
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export * from "./constant";
export * from "./unit";
export * from "./sec/build-box";
export * from "./sec/build-h";
export * from "./sec/pipe";
export * from "./sec/steel";
2 changes: 1 addition & 1 deletion src/sec/build-box.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ B.b = 0.8;
B.t1 = 0.019;
B.t2 = 0.025;

test("SecBuildH.setDimensions", () => {
test("SecBuildBox.setDimensions", () => {
const secBuildBox = new SecBuildBox();
secBuildBox.setDimensions(B.a, B.b, B.t1, B.t2);
expect(secBuildBox.a).toBe(B.a);
Expand Down
68 changes: 68 additions & 0 deletions src/sec/pipe.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { SecPipe } from "./pipe";
import { SecPropertyType } from "../constant";

const P = new SecPipe();
P.d = 0.508;
P.t = 0.009;

test("SecPipe.setDimensions", () => {
const secPipe = new SecPipe();
secPipe.setDimensions(P.d, P.t);
expect(secPipe.d).toBe(P.d);
expect(secPipe.t).toBe(P.t);
expect(secPipe.name).toBe("P-508x9");
});

test("PipeのA", () => {
const A = 1.41088926072718e-2;
const NUM_DIGITS = 15;
expect(SecPipe.area(P.d, P.t)).toBeCloseTo(A, NUM_DIGITS);
expect(P.property(SecPropertyType.Area)).toBeCloseTo(A, NUM_DIGITS);
});

test("PipeのZ", () => {
const Z = 1.72946416752188e-3;
const NUM_DIGITS = 16;
expect(SecPipe.elasticModulusY(P.d, P.t)).toBeCloseTo(Z, NUM_DIGITS);
expect(P.property(SecPropertyType.ElasticModulusY)).toBeCloseTo(
Z,
NUM_DIGITS
);
expect(P.property(SecPropertyType.ElasticModulusZ)).toBeCloseTo(
Z,
NUM_DIGITS
);
});

test("Pipeの単位質量", () => {
const M = 1.10754806967083e2;
const NUM_DIGITS = 10;
expect(P.property(SecPropertyType.MassPerMetre)).toBeCloseTo(M, NUM_DIGITS);
});

test("Pipeのi", () => {
const IY = 1.76451834787854e-1;
const NUM_DIGITS = 14;
expect(P.property(SecPropertyType.RadiusOfGyrationY)).toBeCloseTo(
IY,
NUM_DIGITS
);
expect(P.property(SecPropertyType.RadiusOfGyrationZ)).toBeCloseTo(
IY,
NUM_DIGITS
);
});

test("PipeのI", () => {
const IY = 4.39283898550558e-4;
const NUM_DIGITS = 17;
expect(SecPipe.secondMomentOfAreaY(P.d, P.t)).toBeCloseTo(IY, NUM_DIGITS);
expect(P.property(SecPropertyType.SecondMomentOfAreaY)).toBeCloseTo(
IY,
NUM_DIGITS
);
expect(P.property(SecPropertyType.SecondMomentOfAreaZ)).toBeCloseTo(
IY,
NUM_DIGITS
);
});
99 changes: 99 additions & 0 deletions src/sec/pipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { SecSteel } from "./steel";
import { Unit } from "../unit";
/**
* 円形鋼管
*/
export class SecPipe extends SecSteel {
/** 形状名 */
name: string = "";
/** 直径 D */
d: number = 0.0;
/** 板厚 t */
t: number = 0.0;

/**
* 寸法により初期化し、nameも設定する
* @param d 直径 D
* @param t 板厚 t
*/
setDimensions(d: number, t: number) {
this.d = d;
this.t = t;
const scale: number = Unit.output(1.0, "mm");
d *= scale;
t *= scale;
this.name = `P-${d}x${t}`;
}

/**
* 断面積
* @returns 断面積
*/
area() {
return SecPipe.area(this.d, this.t);
}
/**
* Y軸まわりの断面係数
* @returns Y軸まわりの断面係数
*/
elasticModulusY(): number {
return SecPipe.elasticModulusY(this.d, this.t);
}

/**
* Z軸まわりの断面係数
* @returns Z軸まわりの断面係数
*/
elasticModulusZ(): number {
return SecPipe.elasticModulusY(this.d, this.t);
}

/**
* Y軸まわりの断面二次モーメント
* @returns Y軸まわりの断面二次モーメント
*/
secondMomentOfAreaY(): number {
return SecPipe.secondMomentOfAreaY(this.d, this.t);
}

/**
* Z軸まわりの断面二次モーメント
* @returns Z軸まわりの断面二次モーメント
*/
secondMomentOfAreaZ(): number {
return SecPipe.secondMomentOfAreaY(this.d, this.t);
}

/**
* 円形鋼管の断面積
* 根拠:建築構造ポケットブック第6版 p.35
* @param d 直径 D
* @param t 板厚 t
* @returns 断面積 A
*/
static area(d: number, t: number): number {
return (Math.PI / 4.0) * (d ** 2 - (d - 2 * t) ** 2);
}

/**
* 円形鋼管の断面係数(Y軸まわり)
* (根拠:建築構造ポケットブック第6版 p.35)
* @param d 直径 D
* @param t 板厚 t
* @returns 断面係数(Y軸まわり) ZY
*/
static elasticModulusY(d: number, t: number): number {
return (Math.PI / 32.0) * ((d ** 4 - (d - 2 * t) ** 4) / d);
}

/**
* 円形鋼管の断面二次モーメント(Y軸まわり)
* (根拠:建築構造ポケットブック第6版 p.35)
* @param d 直径 D
* @param t 板厚 t
* @returns 断面二次モーメント(Y軸まわり)IY
*/
static secondMomentOfAreaY(d: number, t: number): number {
return (Math.PI / 64.0) * (d ** 4 - (d - 2 * t) ** 4);
}
}

0 comments on commit fd50e04

Please sign in to comment.