Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import issue #28

Closed
Abdullah-Ajeebi opened this issue Sep 26, 2022 · 2 comments
Closed

import issue #28

Abdullah-Ajeebi opened this issue Sep 26, 2022 · 2 comments

Comments

@Abdullah-Ajeebi
Copy link
Contributor

Abdullah-Ajeebi commented Sep 26, 2022

error log is
Dodge_VGT_V10(86): error R0050: Unresolved reference
Dodge_VGT_V10(87): error R0050: Unresolved reference
Dodge_VGT_V10(88): error R0050: Unresolved reference
Dodge_VGT_V10(107): error R0050: Unresolved reference
Dodge_VGT_V10(113): error R0050: Unresolved reference

engine file is
// Generated with Enginette(https://enginette.netlify.app) by DDev, Pooria and zRevenger.
// More info here: https://github.com/enginette/enginette

import "engine_sim.mr"

units units()
constants constants()
impulse_response_library ir_lib()

label cycle(2 * 360 * units.deg)

private node wires {
output wire1: ignition_wire();
output wire2: ignition_wire();
output wire3: ignition_wire();
output wire4: ignition_wire();
output wire5: ignition_wire();
output wire6: ignition_wire();
output wire7: ignition_wire();
output wire8: ignition_wire();
output wire9: ignition_wire();
output wire10: ignition_wire();
}

private node Dodge_VGT_V10_distributor {
input wires;
input timing_curve;
input rev_limit: 20000 * units.rpm;
input limiter_duration: 0.1 * units.sec;
alias output __out:
ignition_module(timing_curve: timing_curve, rev_limit: rev_limit, limiter_duration: limiter_duration)
.connect_wire(wires.wire1, (0.0 / 10) * cycle)
.connect_wire(wires.wire8, (1.0 / 10) * cycle)
.connect_wire(wires.wire4, (2.0 / 10) * cycle)
.connect_wire(wires.wire6, (3.0 / 10) * cycle)
.connect_wire(wires.wire3, (4.0 / 10) * cycle)
.connect_wire(wires.wire5, (5.0 / 10) * cycle)
.connect_wire(wires.wire2, (6.0 / 10) * cycle)
.connect_wire(wires.wire9, (7.0 / 10) * cycle)
.connect_wire(wires.wire7, (8.0 / 10) * cycle)
.connect_wire(wires.wire10, (9.0 / 10) * cycle);
}

private node add_sym_sample {
input angle;
input lift;
input this;
alias output __out: this;

this.add_sample(angle * units.deg, lift * units.thou)
this.add_sample(-angle * units.deg, lift * units.thou)

}

private node Dodge_VGT_V10_lobe_profile_int {
alias output __out:
harmonic_cam_lobe(
duration_at_50_thou: 160 * units.deg,
gamma: 1,
lift: 200 * units.thou,
steps: 125
);
}

private node Dodge_VGT_V10_lobe_profile_exh {
alias output __out:
harmonic_cam_lobe(
duration_at_50_thou: 160 * units.deg,
gamma: 1,
lift: 200 * units.thou,
steps: 100
);
}

private node Dodge_VGT_V10_camshaft_builder {
input lobe_profile: Dodge_VGT_V10_lobe_profile_int();
input ex_lobe_profile: Dodge_VGT_V10_lobe_profile_exh();
input intake_lobe_profile: lobe_profile;
input exhaust_lobe_profile: ex_lobe_profile;
input lobe_separation: 110 * units.deg;
input intake_lobe_center: lobe_separation;
input exhaust_lobe_center: lobe_separation;
input advance: 0 * units.deg;
input base_radius: 0.6 * units.inch;

output intake_cam_1: _intake_cam_1;
output exhaust_cam_1: _exhaust_cam_1;
output intake_cam_2: _intake_cam_2;
output exhaust_cam_2: _exhaust_cam_2;

camshaft_parameters params(
    advance: advance,
    base_radius: base_radius
)

camshaft _intake_cam_0(params, lobe_profile: intake_lobe_profile)
camshaft _exhaust_cam_0(params, lobe_profile: exhaust_lobe_profile)
camshaft _intake_cam_1(params, lobe_profile: intake_lobe_profile)
camshaft _exhaust_cam_1(params, lobe_profile: exhaust_lobe_profile)

label rot(2 * (360 / 10) * units.deg)
label rot60(60 * units.deg)
label rot90(90 * units.deg)
label rot120(120 * units.deg)
label rot180(180 * units.deg)
label rot360(360 * units.deg)

_exhaust_cam_1
    .add_lobe(rot360 - exhaust_lobe_center + 2*0 * units.deg + 0 * (2 * (360 / 10)))
    .add_lobe(rot360 - exhaust_lobe_center + 2*0 * units.deg + 7 * (2 * (360 / 10)))
    .add_lobe(rot360 - exhaust_lobe_center + 2*0 * units.deg + 3 * (2 * (360 / 10)))
    .add_lobe(rot360 - exhaust_lobe_center + 2*0 * units.deg + 1 * (2 * (360 / 10)))
    .add_lobe(rot360 - exhaust_lobe_center + 2*0 * units.deg + 8 * (2 * (360 / 10)))
_exhaust_cam_2
    .add_lobe(rot360 - exhaust_lobe_center + 2*-144 * units.deg + 5 * (2 * (360 / 10)))
    .add_lobe(rot360 - exhaust_lobe_center + 2*-144 * units.deg + 2 * (2 * (360 / 10)))
    .add_lobe(rot360 - exhaust_lobe_center + 2*-144 * units.deg + 4 * (2 * (360 / 10)))
    .add_lobe(rot360 - exhaust_lobe_center + 2*-144 * units.deg + 6 * (2 * (360 / 10)))
    .add_lobe(rot360 - exhaust_lobe_center + 2*-144 * units.deg + 9 * (2 * (360 / 10)))
_intake_cam_0
_intake_cam_1
    .add_lobe(rot360 + intake_lobe_center + 2*-144 * units.deg + 0 * (2 * (360 / 10)))
    .add_lobe(rot360 + intake_lobe_center + 2*-144 * units.deg + 7 * (2 * (360 / 10)))
    .add_lobe(rot360 + intake_lobe_center + 2*-144 * units.deg + 3 * (2 * (360 / 10)))
    .add_lobe(rot360 + intake_lobe_center + 2*-144 * units.deg + 1 * (2 * (360 / 10)))
    .add_lobe(rot360 + intake_lobe_center + 2*-144 * units.deg + 8 * (2 * (360 / 10)))

}

private node add_flow_sample {
input lift;
input flow;
input this;
alias output __out: this;

this.add_sample(lift * units.mm, k_28inH2O(flow))

}

private node Dodge_VGT_V10_head {
input intake_camshaft;
input exhaust_camshaft;
input chamber_volume: 33 * units.cc;
input flip_display: true;

input flow_attenuation: 1;
input lift_scale: 1;
alias output __out: head;

function intake_flow(1 * units.mm)
intake_flow
    .add_flow_sample(0 * lift_scale, 0 * flow_attenuation)
    .add_flow_sample(1 * lift_scale, 34 * flow_attenuation)
    .add_flow_sample(2 * lift_scale, 62 * flow_attenuation)
    .add_flow_sample(3 * lift_scale, 104 * flow_attenuation)
    .add_flow_sample(4 * lift_scale, 130 * flow_attenuation)
    .add_flow_sample(5 * lift_scale, 140 * flow_attenuation)
    .add_flow_sample(6 * lift_scale, 148 * flow_attenuation)
    .add_flow_sample(7 * lift_scale, 152 * flow_attenuation)
    .add_flow_sample(8 * lift_scale, 154 * flow_attenuation)
    .add_flow_sample(9 * lift_scale, 158 * flow_attenuation)
    .add_flow_sample(10 * lift_scale, 166 * flow_attenuation)
    .add_flow_sample(11 * lift_scale, 172 * flow_attenuation)
    .add_flow_sample(12 * lift_scale, 180 * flow_attenuation)

function exhaust_flow(1 * units.mm)
exhaust_flow
    .add_flow_sample(0 * lift_scale, 0 * flow_attenuation)
    .add_flow_sample(1 * lift_scale, 22 * flow_attenuation)
    .add_flow_sample(2 * lift_scale, 33 * flow_attenuation)
    .add_flow_sample(3 * lift_scale, 60 * flow_attenuation)
    .add_flow_sample(4 * lift_scale, 76 * flow_attenuation)
    .add_flow_sample(5 * lift_scale, 86 * flow_attenuation)
    .add_flow_sample(6 * lift_scale, 92 * flow_attenuation)
    .add_flow_sample(7 * lift_scale, 90 * flow_attenuation)
    .add_flow_sample(8 * lift_scale, 88 * flow_attenuation)
    .add_flow_sample(9 * lift_scale, 84 * flow_attenuation)
    .add_flow_sample(10 * lift_scale, 80 * flow_attenuation)
    .add_flow_sample(11 * lift_scale, 80 * flow_attenuation)
    .add_flow_sample(12 * lift_scale, 72 * flow_attenuation)


cylinder_head head(
    chamber_volume: chamber_volume,
    intake_runner_volume: 100.0 * units.cc,
    intake_runner_cross_section_area: 2 * 12.4087 * units.cm2,

    intake_port_flow: intake_flow,
    exhaust_port_flow: exhaust_flow,
    intake_camshaft: intake_camshaft,
    exhaust_camshaft: exhaust_camshaft,
    flip_display: flip_display
)

}

public node Dodge_VGT_V10 {
alias output __out: engine;

engine engine(
    name: "Dodge_VGT_V10",
    starter_torque: 200 * units.lb_ft,
    starter_speed: 350 * units.rpm,
    redline: 14500 * units.rpm,
    fuel: fuel(
                max_turbulence_effect: 3.0,
        burning_efficiency_randomness: 0.5,
        max_burning_efficiency: 1.25)
)

wires wires()

crankshaft c2(
    throw: 80 * units.mm / 2,
    flywheel_mass: 4 * units.kg,
    mass: 3 * units.kg,
    friction_torque: 10 * units.lb_ft,
    moment_of_inertia: 0.22986844776863666,
    position_x: 0,
    position_y: 0,
    tdc: 120 * units.deg
)

rod_journal rj3(angle: 0 * units.deg)
rod_journal rj4(angle: 0 * units.deg)
rod_journal rj5(angle: 0 * units.deg)
rod_journal rj6(angle: 0 * units.deg)
rod_journal rj7(angle: 0 * units.deg)
rod_journal rj8(angle: 0 * units.deg)
rod_journal rj9(angle: 0 * units.deg)
rod_journal rj10(angle: 0 * units.deg)
rod_journal rj11(angle: 0 * units.deg)
rod_journal rj12(angle: 0 * units.deg)

c2
    .add_rod_journal(rj3)
    .add_rod_journal(rj4)
    .add_rod_journal(rj5)
    .add_rod_journal(rj6)
    .add_rod_journal(rj7)
    .add_rod_journal(rj8)
    .add_rod_journal(rj9)
    .add_rod_journal(rj10)
    .add_rod_journal(rj11)
    .add_rod_journal(rj12)

piston_parameters piston_params3(
    mass: 400 * units.g,
    compression_height: 32 * units.mm,
    wrist_pin_position: 0,
    displacement: 0
)

piston_parameters piston_params4(
    mass: 400 * units.g,
    compression_height: 32 * units.mm,
    wrist_pin_position: 0,
    displacement: 0
)

piston_parameters piston_params5(
    mass: 400 * units.g,
    compression_height: 32 * units.mm,
    wrist_pin_position: 0,
    displacement: 0
)

piston_parameters piston_params6(
    mass: 400 * units.g,
    compression_height: 32 * units.mm,
    wrist_pin_position: 0,
    displacement: 0
)

piston_parameters piston_params7(
    mass: 400 * units.g,
    compression_height: 32 * units.mm,
    wrist_pin_position: 0,
    displacement: 0
)

piston_parameters piston_params8(
    mass: 400 * units.g,
    compression_height: 32 * units.mm,
    wrist_pin_position: 0,
    displacement: 0
)

piston_parameters piston_params9(
    mass: 400 * units.g,
    compression_height: 32 * units.mm,
    wrist_pin_position: 0,
    displacement: 0
)

piston_parameters piston_params10(
    mass: 400 * units.g,
    compression_height: 32 * units.mm,
    wrist_pin_position: 0,
    displacement: 0
)

piston_parameters piston_params11(
    mass: 400 * units.g,
    compression_height: 32 * units.mm,
    wrist_pin_position: 0,
    displacement: 0
)

piston_parameters piston_params12(
    mass: 400 * units.g,
    compression_height: 32 * units.mm,
    wrist_pin_position: 0,
    displacement: 0
)

connecting_rod_parameters cr_params3(
    mass: 240 * units.g,
    moment_of_inertia: 0.0015884918028487504 * 0.9,
    center_of_mass: 0.0,
    length: 131.6 * units.mm
)

connecting_rod_parameters cr_params4(
    mass: 240 * units.g,
    moment_of_inertia: 0.0015884918028487504 * 0.9,
    center_of_mass: 0.0,
    length: 131.6 * units.mm
)

connecting_rod_parameters cr_params5(
    mass: 240 * units.g,
    moment_of_inertia: 0.0015884918028487504 * 0.9,
    center_of_mass: 0.0,
    length: 131.6 * units.mm
)

connecting_rod_parameters cr_params6(
    mass: 240 * units.g,
    moment_of_inertia: 0.0015884918028487504 * 0.9,
    center_of_mass: 0.0,
    length: 131.6 * units.mm
)

connecting_rod_parameters cr_params7(
    mass: 240 * units.g,
    moment_of_inertia: 0.0015884918028487504 * 0.9,
    center_of_mass: 0.0,
    length: 131.6 * units.mm
)

connecting_rod_parameters cr_params8(
    mass: 240 * units.g,
    moment_of_inertia: 0.0015884918028487504 * 0.9,
    center_of_mass: 0.0,
    length: 131.6 * units.mm
)

connecting_rod_parameters cr_params9(
    mass: 240 * units.g,
    moment_of_inertia: 0.0015884918028487504 * 0.9,
    center_of_mass: 0.0,
    length: 131.6 * units.mm
)

connecting_rod_parameters cr_params10(
    mass: 240 * units.g,
    moment_of_inertia: 0.0015884918028487504 * 0.9,
    center_of_mass: 0.0,
    length: 131.6 * units.mm
)

connecting_rod_parameters cr_params11(
    mass: 240 * units.g,
    moment_of_inertia: 0.0015884918028487504 * 0.9,
    center_of_mass: 0.0,
    length: 131.6 * units.mm
)

connecting_rod_parameters cr_params12(
    mass: 240 * units.g,
    moment_of_inertia: 0.0015884918028487504 * 0.9,
    center_of_mass: 0.0,
    length: 131.6 * units.mm
)

intake intake2(
    intake_flow_rate: k_carb(300),
    idle_flow_rate: k_carb(0),
    idle_throttle_plate_position: 0.98,
    throttle_gamma: 1
)

exhaust_system_parameters es_params2(
    outlet_flow_rate: k_carb(200),
    primary_tube_length: 10 * units.inch,
    primary_flow_rate: k_carb(300),
    velocity_decay: 1, //0.5
    volume: 10 * units.L
)

exhaust_system exhaust2(es_params2, audio_volume: 0.7, impulse_response: ir_lib.default_0)

cylinder_bank b2(bore: 105.42 * units.mm, deck_height: (205 + 1) * units.mm, angle: 0 * units.deg)
b2
    .add_cylinder(
        piston: piston(piston_params3, blowby: k_28inH2O(0.1)),
        connecting_rod: connecting_rod(cr_params3),
        rod_journal: rj3,
        intake: intake2,
        exhaust_system: exhaust2,
        ignition_wire: wires.wire1
    )
    .add_cylinder(
        piston: piston(piston_params4, blowby: k_28inH2O(0.1)),
        connecting_rod: connecting_rod(cr_params4),
        rod_journal: rj4,
        intake: intake2,
        exhaust_system: exhaust2,
        ignition_wire: wires.wire2
    )
    .add_cylinder(
        piston: piston(piston_params5, blowby: k_28inH2O(0.1)),
        connecting_rod: connecting_rod(cr_params5),
        rod_journal: rj5,
        intake: intake2,
        exhaust_system: exhaust2,
        ignition_wire: wires.wire3
    )
    .add_cylinder(
        piston: piston(piston_params6, blowby: k_28inH2O(0.1)),
        connecting_rod: connecting_rod(cr_params6),
        rod_journal: rj6,
        intake: intake2,
        exhaust_system: exhaust2,
        ignition_wire: wires.wire4
    )
    .add_cylinder(
        piston: piston(piston_params7, blowby: k_28inH2O(0.1)),
        connecting_rod: connecting_rod(cr_params7),
        rod_journal: rj7,
        intake: intake2,
        exhaust_system: exhaust2,
        ignition_wire: wires.wire5
    )
engine.add_cylinder_bank(b2)

cylinder_bank b3(bore: 105.42 * units.mm, deck_height: (200 + 1) * units.mm, angle: 144 * units.deg)
b3
    .add_cylinder(
        piston: piston(piston_params8, blowby: k_28inH2O(0.1)),
        connecting_rod: connecting_rod(cr_params8),
        rod_journal: rj8,
        intake: intake2,
        exhaust_system: exhaust2,
        ignition_wire: wires.wire6
    )
    .add_cylinder(
        piston: piston(piston_params9, blowby: k_28inH2O(0.1)),
        connecting_rod: connecting_rod(cr_params9),
        rod_journal: rj9,
        intake: intake2,
        exhaust_system: exhaust2,
        ignition_wire: wires.wire7
    )
    .add_cylinder(
        piston: piston(piston_params10, blowby: k_28inH2O(0.1)),
        connecting_rod: connecting_rod(cr_params10),
        rod_journal: rj10,
        intake: intake2,
        exhaust_system: exhaust2,
        ignition_wire: wires.wire8
    )
    .add_cylinder(
        piston: piston(piston_params11, blowby: k_28inH2O(0.1)),
        connecting_rod: connecting_rod(cr_params11),
        rod_journal: rj11,
        intake: intake2,
        exhaust_system: exhaust2,
        ignition_wire: wires.wire9
    )
    .add_cylinder(
        piston: piston(piston_params12, blowby: k_28inH2O(0.1)),
        connecting_rod: connecting_rod(cr_params12),
        rod_journal: rj12,
        intake: intake2,
        exhaust_system: exhaust2,
        ignition_wire: wires.wire10
    )
engine.add_cylinder_bank(b3)

engine.add_crankshaft(c2)

Dodge_VGT_V10_camshaft_builder camshaft(
    lobe_profile: Dodge_VGT_V10_lobe_profile_int(),
       ex_lobe_profile: Dodge_VGT_V10_lobe_profile_exh()
)

b2.set_cylinder_head (
    Dodge_VGT_V10_head(
        intake_camshaft: camshaft.intake_cam_1,
        exhaust_camshaft: camshaft.exhaust_cam_1
    )
)

b3.set_cylinder_head (
    Dodge_VGT_V10_head(
        intake_camshaft: camshaft.intake_cam_2,
        exhaust_camshaft: camshaft.exhaust_cam_2
    )
)

function timing_curve(1000 * units.rpm)
timing_curve
    .add_sample(0 * units.rpm, 0 * units.deg)
    .add_sample(1000 * units.rpm, 30 * units.deg)
    .add_sample(2000 * units.rpm, 30 * units.deg)
    .add_sample(3000 * units.rpm, 30 * units.deg)
    .add_sample(4000 * units.rpm, 30 * units.deg)
    .add_sample(5000 * units.rpm, 30 * units.deg)
    .add_sample(6000 * units.rpm, 30 * units.deg)
    .add_sample(7000 * units.rpm, 30 * units.deg)
    .add_sample(8000 * units.rpm, 30 * units.deg)
    .add_sample(9000 * units.rpm, 30 * units.deg)
    .add_sample(10000 * units.rpm, 30 * units.deg)
    .add_sample(11000 * units.rpm, 30 * units.deg)
    .add_sample(12000 * units.rpm, 30 * units.deg)
    .add_sample(13000 * units.rpm, 30 * units.deg)
    .add_sample(14000 * units.rpm, 30 * units.deg)
    .add_sample(15000 * units.rpm, 30 * units.deg)
    .add_sample(16000 * units.rpm, 30 * units.deg)
    .add_sample(17000 * units.rpm, 30 * units.deg)
    .add_sample(18000 * units.rpm, 30 * units.deg)
    .add_sample(19000 * units.rpm, 30 * units.deg)
    .add_sample(20000 * units.rpm, 30 * units.deg)

engine.add_ignition_module(
    Dodge_VGT_V10_distributor(
        wires: wires,
        timing_curve: timing_curve,
        rev_limit: 20000 * units.rpm
    ))

}

@Abdullah-Ajeebi
Copy link
Contributor Author

over 48 hours and no answers

@Abdullah-Ajeebi
Copy link
Contributor Author

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant