tum-pbs / PhiFlow

A differentiable PDE solving framework for machine learning
MIT License
1.39k stars 189 forks source link

Channel flow #134

Closed sjtuytc closed 11 months ago

sjtuytc commented 1 year ago

Hi, how can I create a channel flow as shown in https://nbviewer.org/github/barbagroup/CFDPython/blob/master/lessons/15_Step_12.ipynb?

holl- commented 1 year ago

Hi, check out the pipe demo!

sjtuytc commented 1 year ago

AttributeError: 'NoneType' object has no attribute 'file' image

holl- commented 1 year ago

To run it in a notebook, replace that line with a regular range loop, i.e. no call to view().

shassan97 commented 10 months ago

Hi, My installed versions are phiflow-2.5.0 phiml-1.1.0 While running the pipe demo, I am getting the following error

 * Serving Flask app 'PhiFlow'
 * Debug mode: off
Traceback (most recent call last):
  File "/Users/sheikhmdshakeelhassan/Projects/PhiFlow/demos/pipe.py", line 13, in <module>
    velocity, pressure = fluid.make_incompressible(velocity, solve=Solve(x0=pressure))
  File "/Users/sheikhmdshakeelhassan/envs/torchenv/lib/python3.9/site-packages/phi/physics/fluid.py", line 105, in make_incompressible
    accessible_extrapolation = _accessible_extrapolation(input_velocity.extrapolation)
  File "/Users/sheikhmdshakeelhassan/envs/torchenv/lib/python3.9/site-packages/phi/physics/fluid.py", line 244, in _accessible_extrapolation
    return combine_sides(**{dim: (_accessible_extrapolation(lo), _accessible_extrapolation(hi)) for dim, (lo, hi) in vext.ext.items()})
  File "/Users/sheikhmdshakeelhassan/envs/torchenv/lib/python3.9/site-packages/phi/physics/fluid.py", line 244, in <dictcomp>
    return combine_sides(**{dim: (_accessible_extrapolation(lo), _accessible_extrapolation(hi)) for dim, (lo, hi) in vext.ext.items()})
ValueError: too many values to unpack (expected 2)
holl- commented 10 months ago

Looks like a bug in PhiML 1.1.0.

Try with pip install phiml==1.0.1.

holl- commented 10 months ago

I've pushed a fix to develop.

pip uninstall phiflow
pip install git+https://github.com/tum-pbs/PhiFlow.git@develop
shassan97 commented 10 months ago

Thank you for the quick fix. It works now.