Skip to content

Commit

Permalink
Remove preprod() calls and add project_length_unit arg (#618)
Browse files Browse the repository at this point in the history
* Fix doc

* More fix

* More fix
  • Loading branch information
benflexcompute committed Dec 12, 2024
1 parent 50549e2 commit 97c9f30
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
3 changes: 0 additions & 3 deletions examples/retrieve_results/x_force_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
from flow360.component.simulation.unit_system import SI_unit_system, u
from flow360.examples import Airplane

fl.Env.preprod.active()


project = Project.from_file(Airplane.geometry, name="Python Project (Geometry, from file)")
geo = project.geometry

Expand Down
3 changes: 0 additions & 3 deletions examples/show_storage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import flow360.v1 as fl

fl.Env.preprod.active()


fl.Folder.print_storage()
13 changes: 4 additions & 9 deletions examples/tutorials/notebook/notebook_tutorial_2D_crm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "7fcf1076-2485-4ed0-a642-347010c4953c",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -654,9 +654,6 @@
}
],
"source": [
"# Activate the preprod environment\n",
"fl.Env.preprod.active()\n",
"\n",
"# Download files associated with the tutorial\n",
"Tutorial2DCRM.get_files()\n",
"\n",
Expand Down Expand Up @@ -899,7 +896,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "48bb6d71-298a-442e-80ff-9f6170ac6aab",
"metadata": {},
"outputs": [
Expand All @@ -923,7 +920,7 @@
"\n",
" # Create operating conditions using mach and reynolds number\n",
" operating_condition=fl.operating_condition_from_mach_reynolds(\n",
" mach=0.2, reynolds=5e6, temperature=272.1, alpha=16 * u.deg, beta=0 * u.deg\n",
" mach=0.2, reynolds=5e6, temperature=272.1, alpha=16 * u.deg, beta=0 * u.deg, project_length_unit=1 * u.m\n",
" ),\n",
" )"
]
Expand Down Expand Up @@ -1593,8 +1590,6 @@
"from flow360.component.simulation.unit_system import SI_unit_system, u\n",
"from flow360.examples import Tutorial2DCRM\n",
"\n",
"fl.Env.preprod.active()\n",
"\n",
"Tutorial2DCRM.get_files()\n",
"\n",
"project = fl.Project.from_file(Tutorial2DCRM.geometry, name=\"Tutorial 2D CRM from Python\")\n",
Expand Down Expand Up @@ -1669,7 +1664,7 @@
" moment_center=[0.25, 0, 0], moment_length=[1, 1, 1], area=0.01\n",
" ),\n",
" operating_condition=fl.operating_condition_from_mach_reynolds(\n",
" mach=0.2, reynolds=5e6, temperature=272.1, alpha=16 * u.deg, beta=0 * u.deg\n",
" mach=0.2, reynolds=5e6, temperature=272.1, alpha=16 * u.deg, beta=0 * u.deg, project_length_unit=1 * u.m\n",
" ),\n",
" time_stepping=fl.Steady(\n",
" max_steps=3000, CFL=fl.RampCFL(initial=20, final=300, ramp_steps=500)\n",
Expand Down
1 change: 1 addition & 0 deletions tests/simulation/params/test_simulation_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ def test_mach_reynolds_op_cond():
mach=0.2,
reynolds=0,
temperature=288.15 * u.K,
project_length_unit=u.m,
)


Expand Down

0 comments on commit 97c9f30

Please sign in to comment.