tum-pbs / PhiFlow

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

Error when I want to run demo #142

Closed HDFengChina closed 9 months ago

HDFengChina commented 9 months ago

I copied the demos like rotating bar and run them based on different version of PhiFlow.

An error AttributeError: 'NoneType' object has no attribute 'file' always occured.

Do you know the reason?

Thank you.

HDFengChina commented 9 months ago

Error occured on "for _ in view('vorticity,velocity,pressure', namespace=globals()).range():"

holl- commented 9 months ago

What version of PhiFlow are you on? You can check using import phi; phi.verify().

Also, could you send the full error stack trace?

HDFengChina commented 9 months ago

What version of PhiFlow are you on? You can check using import phi; phi.verify().

Also, could you send the full error stack trace?

Thanks for your reply. It works in the version 2.5.1. It is a very useful tool for me.

holl- commented 9 months ago

Glad to hear! So the error only occurred in an older version and is gone in 2.5.1, right?

HDFengChina commented 9 months ago

Glad to hear! So the error only occurred in an older version and is gone in 2.5.1, right?

Sure.

But it is difficult to determine whether it is the issue on my environmental or the phiflow. Anyway, the problem has been resolved.

HDFengChina commented 9 months ago

Glad to hear! So the error only occurred in an older version and is gone in 2.5.1, right?

One more question.

Where is the Reynolds number located when solving the PDE? Maybe it is calculated by density, viscosity, inflow velocity. I think by changing the inflow velocity I can change the Reynolds number. But I did not find its definition in the code.

Thanks for your help.

holl- commented 9 months ago

The Reynolds number can be computed from your viscosity, characteristic velocity and characterstic length scale. So for a fixed setup, you can vary the viscosity (diffusivity) to affect the Reynolds number. See this demo for a fluid with diffusion.

HDFengChina commented 9 months ago

The Reynolds number can be computed from your viscosity, characteristic velocity and characterstic length scale. So for a fixed setup, you can vary the viscosity (diffusivity) to affect the Reynolds number. See this demo for a fluid with diffusion.

Thanks for your answer, It can solve my problem.

holl- commented 9 months ago

Perfect!