import { describe, it, expect } from 'vitest';
import { reynoldsBar, getCircleBarDragCoefficient, reynoldsRegime } from '../nbr-tables/table-27';
import { reynoldsCylinder, isSupercritical } from '../nbr-tables/table-13';

describe('Reynolds (sec. 6.2.1, 8.1.2)', () => {
  it('Re = 70 000 · Vk · d', () => {
    expect(reynoldsCylinder(40, 5)).toBe(14000000);
    expect(reynoldsBar(40, 0.05)).toBe(140000);
  });

  it('Regime subcrítico: Re < 4,2e5', () => {
    expect(reynoldsRegime(1e5)).toBe('subcritical');
  });
  it('Regime crítico: 4,2e5 ≤ Re < 2,3e6', () => {
    expect(reynoldsRegime(5e5)).toBe('critical-1');
  });
  it('Regime supercrítico: Re ≥ 2,3e6', () => {
    expect(reynoldsRegime(3e6)).toBe('supercritical');
    expect(isSupercritical(5e6)).toBe(true);
  });

  it('Ca para barra circular — subcrítico = 1,2', () => {
    expect(getCircleBarDragCoefficient(1e5)).toBe(1.2);
  });
  it('Ca para barra circular — supercrítico = 0,6', () => {
    expect(getCircleBarDragCoefficient(3e6)).toBe(0.6);
  });
});