SimVascular / SimVascular/svVascularize

Simulation Failed

Open
#30 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
19
Forks
11
Avg merge
1h 58m
Merged PRs (30d)
19

Description

Description

Traceback (most recent call last):
File "C:\Users\micha\Downloads\Pyvista_examples\Cube_Perfusion.py", line 25, in
sim.write_3d_fluid_simulation()
File "C:\Users\micha\miniconda3\envs\svv\lib\site-packages\svv\simulation\simulation.py", line 596, in write_3d_fluid_simulation
simulation_file, fluid_mesh = self.fluid_simulations[0]
AttributeError: 'Simulation' object has no attribute 'fluid_simulations'

Reproduction

import pyvista as pv
from svv.domain.domain import Domain
from svv.tree.tree import Tree
from svv.simulation.simulation import Simulation

cube = Domain(pv.Cube())
cube.create()
cube.solve()
cube.build()

t = Tree()
t.set_domain(cube)
t.set_root()
t.n_add(2)

Create Simulation Container for Synthetic Tree Object

sim = Simulation(t)

Build All Surface/Volume Meshes for 3D CFD Simulation

sim.build_meshes(fluid=True,boundary_layer=False)

Build and persist 3-D CFD input files

sim.extract_faces()
sim.construct_3d_fluid_simulation()
sim.write_3d_fluid_simulation()

Result: meshes + XML under sim.file_path (e.g. ./simulations/example/)

from svv.simulation.fluid.rom.zero_d.zerod_tree import export_0d_simulation

export_0d_simulation(t, outdir=sim.file_path + "/rom_0d")

Optionally stage 1-D parameters for multi-scale workflows

sim.construct_1d_fluid_simulation(time_step_size=1e-3, number_time_steps=2000)

Expected behavior

fluid_mesh should not be empty.

Additional context

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at svv/simulation/simulation.py line 596, where write_3d_fluid_simulation accesses fluid_simulations, and trace the preceding construct_3d_fluid_simulation and extract_faces calls from the reproduction. Confirm why the Simulation instance lacks the expected state; done means the supplied script completes, fluid_mesh is populated, and the documented meshes and XML are written.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.