From d6f220a1ac8e226d2411944b5eae466876dde871 Mon Sep 17 00:00:00 2001 From: tpvora-lgtm Date: Wed, 14 Jan 2026 10:42:36 -0500 Subject: [PATCH 1/4] Updatecommunity_wind_simulation.py --- .../community_wind_simulation.py | 939 +++++++++++++++--- 1 file changed, 826 insertions(+), 113 deletions(-) diff --git a/modules/createEVENT/advancedCFDWithBRAILS/community_wind_simulation.py b/modules/createEVENT/advancedCFDWithBRAILS/community_wind_simulation.py index a4f7d6112..01b3275e5 100644 --- a/modules/createEVENT/advancedCFDWithBRAILS/community_wind_simulation.py +++ b/modules/createEVENT/advancedCFDWithBRAILS/community_wind_simulation.py @@ -1,4 +1,4 @@ -from __future__ import annotations +from __future__ import annotations import argparse from pathlib import Path import sys, math @@ -419,6 +419,96 @@ class dictionary; } """) +TP_RANSkw = textwrap.dedent(""" +/*--------------------------------*- C++ -*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 10 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\\*---------------------------------------------------------------------------*/ +FoamFile{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} + +simulationType RAS; + +RAS +{ + RASModel kOmega; + turbulence on; + printCoeffs on; + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } +} +""") + +TP_RANSkwSST = textwrap.dedent(""" +/*--------------------------------*- C++ -*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 10 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\\*---------------------------------------------------------------------------*/ +FoamFile{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} + +simulationType RAS; + +RAS +{ + RASModel kOmegaSST; + turbulence on; + printCoeffs on; + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } +} +""") + +TP_RANSkwSSTSAS = textwrap.dedent(""" +/*--------------------------------*- C++ -*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 10 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\\*---------------------------------------------------------------------------*/ +FoamFile{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} + +simulationType RAS; + +RAS +{ + RASModel kOmegaSSTSAS; + turbulence on; + printCoeffs on; + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } +} +""") + TP_LES = textwrap.dedent(""" /*--------------------------------*- C++ -*----------------------------------*\\ | ========= | | @@ -450,6 +540,162 @@ class dictionary; } """) +TP_LESWale = textwrap.dedent(""" +/*--------------------------------*- C++ -*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 10 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\\*---------------------------------------------------------------------------*/ +FoamFile{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} + +simulationType LES; + +LES +{ + LESModel WALE; + delta cubeRootVol; + turbulence on; + printCoeffs on; + cubeRootVolCoeffs + { + deltaCoeff 1; + } +} +""") + +TP_LESKeqn = textwrap.dedent(""" +/*--------------------------------*- C++ -*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 10 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\\*---------------------------------------------------------------------------*/ +FoamFile{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} + +simulationType LES; + +LES +{ + LESModel kEqn; + delta cubeRootVol; + turbulence on; + printCoeffs on; + cubeRootVolCoeffs + { + deltaCoeff 1; + } +} +""") + +TP_LESDKeqn = textwrap.dedent(""" +/*--------------------------------*- C++ -*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 10 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\\*---------------------------------------------------------------------------*/ +FoamFile{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} + +simulationType LES; + +LES +{ + LESModel dynamicKEqn; + delta cubeRootVol; + turbulence on; + printCoeffs on; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + dynamicKEqnCoeffs + { + filter simple; + } +} +""") + +TP_DES = textwrap.dedent(""" +/*--------------------------------*- C++ -*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 10 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\\*---------------------------------------------------------------------------*/ +FoamFile{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} + +simulationType LES; + +LES +{ + LESModel SpalartAllmarasDES; + delta cubeRootVol; + turbulence on; + printCoeffs on; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + +} +""") + +TP_DDES = textwrap.dedent(""" +/*--------------------------------*- C++ -*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 10 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\\*---------------------------------------------------------------------------*/ +FoamFile{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} + +simulationType LES; + +LES +{ + LESModel SpalartAllmarasDDES; + delta cubeRootVol; + turbulence on; + printCoeffs on; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + +} +""") + # ───────────── field file header ───────────── FIELD_HEADER = """ """ @@ -581,6 +827,42 @@ class volScalarField; }} """) +def body_ksgs(side): + return textwrap.dedent(f""" + /*--------------------------------*- C++ -*----------------------------------*\\ + | ========= | | + | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | + | \\ / O peration | Version: 10 | + | \\ / A nd | Web: www.OpenFOAM.org | + | \\/ M anipulation | | + \\*---------------------------------------------------------------------------*/ + FoamFile + {{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; + }} + dimensions [0 2 -2 0 0 0 0]; + internalField uniform 0.001; + boundaryField + {{ + inlet + {{ + type fixedValue; + value uniform 0.005; + }} + outlet {{ type zeroGradient; }} + side1 {{ type {side}; }} + side2 {{ type {side}; }} + top {{ type slip; }} + ground {{ type kqRWallFunction; value $internalField; }} + ROI {{ type kqRWallFunction; value $internalField; }} + Surrounding {{ type kqRWallFunction; value $internalField; }} + }} + """) + def body_eps(side, Uref, Href, z0): return textwrap.dedent(f""" /*--------------------------------*- C++ -*----------------------------------*\\ @@ -625,6 +907,60 @@ class volScalarField; }} """) +def body_omega(side,Uref,Href,z0): + return textwrap.dedent(f""" + /*--------------------------------*- C++ -*----------------------------------*\\ + | ========= | | + | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | + | \\ / O peration | Version: 10 | + | \\ / A nd | Web: www.OpenFOAM.org | + | \\/ M anipulation | | + \\*---------------------------------------------------------------------------*/ + FoamFile + {{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; + }} + dimensions [0 0 -1 0 0 0 0]; + internalField uniform 100; + boundaryField + {{ + inlet + {{ + type codedFixedValue; + value uniform 100; + name omegaCoded; + code + #{{ + const scalar Bs = 0.09; + const fvPatch& patch = this->patch(); + const vectorField& cf = patch.Cf(); + scalarField& field = *this; + forAll(cf,i) + {{ + field[i] = {Uref}/(sqrt(Bs)*(cf[i].z()+{z0})*{math.log((Href+z0)/z0)}); + }} + #}}; + }} + outlet {{ type zeroGradient; }} + side1 {{ type {side}; }} + side2 {{ type {side}; }} + top {{ type slip; }} + ground {{ type omegaWallFunction; + blended true; + value $internalField; }} + ROI {{ type omegaWallFunction; + blended true; + value $internalField; }} + Surrounding {{ type omegaWallFunction; + blended true; + value $internalField; }} + }} + """) + def body_nut(side, ground_style, z0, Uref, Href, roi_style, surround_style): if ground_style == "rough": gf = f"type nutkAtmRoughWallFunction;\n z0 uniform {z0};\n value uniform 0;" @@ -943,17 +1279,87 @@ class dictionary; class dictionary; object surfaceFeaturesDict; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +surfaces ("Surrounding.stl" "ROI.stl"); +#includeEtc "caseDicts/surface/surfaceFeaturesDict.cfg" + +// ************************************************************************* // + + +""") + +TP_fvSch_RANS = textwrap.dedent(""" +/*--------------------------------*- C++ -*----------------------------------*\\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: www.OpenFoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default cellLimited Gauss linear 0.5; +} + +divSchemes +{ + default none; + div(phi,U) bounded Gauss linearUpwindV grad(U); + div(phi,k) bounded Gauss upwind; + div(phi,epsilon) bounded Gauss upwind; + div(phi,omega) bounded Gauss upwind; + div((nuEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear limited 0.5; +} + +interpolationSchemes +{ + default linear; + interpolate(U) linear; +} + +snGradSchemes +{ + default limited 0.5; +} + +fluxRequired +{ + default no; + p ; +} -surfaces ("Surrounding.stl" "ROI.stl"); -#includeEtc "caseDicts/surface/surfaceFeaturesDict.cfg" +wallDist +{ + method meshWave; +} // ************************************************************************* // """) -TP_fvSch_RANS = textwrap.dedent(""" +TP_fvSch_URANS = textwrap.dedent(""" /*--------------------------------*- C++ -*----------------------------------*\\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox @@ -973,7 +1379,7 @@ class dictionary; ddtSchemes { - default steadyState; + default Euler; } gradSchemes @@ -987,6 +1393,7 @@ class dictionary; div(phi,U) bounded Gauss linearUpwindV grad(U); div(phi,k) bounded Gauss upwind; div(phi,epsilon) bounded Gauss upwind; + div(phi,omega) bounded Gauss upwind; div((nuEff*dev2(T(grad(U))))) Gauss linear; } @@ -1012,6 +1419,10 @@ class dictionary; p ; } +wallDist +{ + method meshWave; +} // ************************************************************************* // @@ -1093,6 +1504,17 @@ class dictionary; maxIter 100; // limitation of iterations number } + omega + { + solver smoothSolver; // solver type + smoother GaussSeidel; // smoother type + tolerance 1e-09; // solver finishes if either absolute + relTol 0.001; // tolerance is reached or the relative + // tolerance here + nSweeps 1; // setting for smoothSolver + maxIter 100; // limitation of iterations number + } + R { solver PBiCG; @@ -1135,6 +1557,7 @@ class dictionary; U 0.7; k 0.7; epsilon 0.7; + omega 0.7; R 0.7; nuTilda 0.7; } @@ -1290,6 +1713,139 @@ class dictionary; // ************************************************************************* // +""") + +TP_fvSol_URANS = textwrap.dedent(""" +/*--------------------------------*- C++ -*----------------------------------*\\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: www.OpenFoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 0; + relTol 0.05; + smoother GaussSeidel; + cacheAgglomeration true; + nCellsInCoarsestLevel 100; + agglomerator faceAreaPair; + mergeLevels 1; + } + + pFinal + { + $p; + smoother DICGaussSeidel; + tolerance 1e-06; + relTol 0.01; + } + + U // linear equation system solver for U + { + solver smoothSolver; // solver type + smoother GaussSeidel; // smoother type + tolerance 1e-09; // solver finishes if either absolute + relTol 0.001; // tolerance is reached or the relative + // tolerance here + nSweeps 1; // setting for smoothSolver + maxIter 100; // limitation of iterations number + } + + k + { + solver smoothSolver; // solver type + smoother GaussSeidel; // smoother type + tolerance 1e-09; // solver finishes if either absolute + relTol 0.001; // tolerance is reached or the relative + // tolerance here + nSweeps 1; // setting for smoothSolver + maxIter 100; // limitation of iterations number + } + + epsilon + { + solver smoothSolver; // solver type + smoother GaussSeidel; // smoother type + tolerance 1e-09; // solver finishes if either absolute + relTol 0.001; // tolerance is reached or the relative + // tolerance here + nSweeps 1; // setting for smoothSolver + maxIter 100; // limitation of iterations number + } + + omega + { + solver smoothSolver; // solver type + smoother GaussSeidel; // smoother type + tolerance 1e-09; // solver finishes if either absolute + relTol 0.001; // tolerance is reached or the relative + // tolerance here + nSweeps 1; // setting for smoothSolver + maxIter 100; // limitation of iterations number + } + + R + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; +// relTol 0.1; + relTol 0.001; + } + + nuTilda + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-08; + relTol 0.1; + maxIter 5; + } + + "(U|k|nuTilda|epsilon|omega)Final" + { + $U; + tolerance 1e-08; + relTol 0.05; + } +} + +PIMPLE +{ + nOuterCorrectors 1; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + //pRefCell 1001; + //pRefValue 0; +} + +PISO +{ + nOuterCorrectors 1; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + //pRefCell 1001; + //pRefValue 0; +} + +// ************************************************************************* // + + """) # ────────────────────────── Generate profile and plane ────────────────────── @@ -1324,63 +1880,12 @@ def generate_include_func(n_profile, n_plane) -> str: functions = "\n ".join(includes) return functions -def create_profile_txt(n_profile: int, profile_out: Path) -> None: - - for i in range(1, n_profile+1): - print(f"\n--- Configuring Profile{i} ---") - - start = tuple(map(float, get_input(" Start point (x y z)", "0 0 0").split())) - end = tuple(map(float, get_input(" End point (x y z)", "0 0 0").split())) - n_points = int(get_input(" Number of points along the probe line", "5")) - fields = get_input("Field write {U or p or U p}", "U") - while fields not in FIELD_MAP: - fields = get_input(" -> Please choose U or p or U p", "U") - N_profile = get_input("Field write interval", "10") - t_start = get_input(" Time start", "0") - - # generate probe locations - points = generate_line_points(start, end, n_points) - - # fill template - profile_text = TP_PROFILE.format( - ProfileName=f"Profile{i}", - N_profile=N_profile, - t_start=t_start, - fields=fields, - points=points - ) - - out_path = profile_out.parent / f"Profile{i}" - out_path.write_text(profile_text) - print(f" Profile written to {out_path.resolve()}") - -def create_plane_txt(N_plane: int, plane_out: Path) -> None: - for i in range(1, N_plane+1): - print(f"\n--- Configuring Plane{i} ---") - - N_plane = get_input("Plane write interval", "10") - t_start = get_input(" Time start", "0.000000") - t_end = get_input(" Time end", "10.000000") - fields = get_input("Field write {U or p or U p}", "U") - while fields not in FIELD_MAP: - fields = get_input(" -> Please choose U or p or U p", "U") - plane_point = "(" + " ".join(get_input(" Point in plane (x y z)", "0 0 0").split()) + ")" - plane_normal = "(" + " ".join(get_input(" Normal vector to plane (x y z)", "0 0 0").split()) + ")" +#def create_profile_txt(n_profile: int, profile_out: Path) -> None: - # fill template - plane_text = TP_PLANE.format( - PlaneName=f"Plane{i}", - N_plane=N_plane, - t_start=t_start, - t_end=t_end, - fields=fields, - plane_point=plane_point, - plane_normal=plane_normal - ) + - out_path = plane_out.parent / f"Plane{i}" - out_path.write_text(plane_text) - print(f" Plane written to {out_path.resolve()}") +#def create_plane_txt(N_plane: int, plane_out: Path) -> None: + # ───────────────────────── Check if the path existss ───────────────────────── @@ -1513,7 +2018,7 @@ def main(config: Dict[str, Any]) -> None: Tfootprints = Scraper({"length": "m"}).get_footprints(regionT) Tfootprints.write_to_geojson(out_path) - print(f" GeoJSON written to {out_path.resolve()}") + print(f"✓ GeoJSON written to {out_path.resolve()}") @@ -1529,7 +2034,7 @@ def main(config: Dict[str, Any]) -> None: inventory = scraper.get_footprints(regionR) inventory.write_to_geojson(out_file) - print(f" Footprints saved to {out_file.resolve()}") + print(f"✓ Footprints saved to {out_file.resolve()}") full = out_path roi = out_file @@ -1631,7 +2136,7 @@ def mesh(gdf): return m write_stl_ascii(mesh(gdf_roi), roi_stl, "ROI") write_stl_ascii(mesh(rest), rest_stl, "Surrounding") - print(" STL files created.") + print("✓ STL files created.") # --- compute bounds --------------------------------------------------- verts=np.vstack([trimesh.load_mesh(str(roi_stl)).vertices, @@ -1665,9 +2170,8 @@ def mesh(gdf): write_bmd(x0,x1,y0,y1,z0,z1,nx,ny,nz,side_choice, case/"system"/"blockMeshDict") - print(" blockMeshDict written.") - - print(f"Applied rotation -{angle_deg} so wind aligns with +x.") + print("✓ blockMeshDict written.") + print(f"Applied rotation −{angle_deg}° so wind aligns with +x.") print(f"Extents: ({x0},{y0},{z0}) to ({x1},{y1},{z1})") # ───────────────────────── Write snappyHexMesh ───────────────────────── @@ -1769,7 +2273,7 @@ def mesh(gdf): Path(case/"system"/"snappyHexMeshDict").write_text(dict_text) Path(case/"system"/"surfaceFeaturesDict").write_text(TP_surfFeat) - print(f" snappyHexMeshDict written to {Path(case/"system"/"snappyHexMeshDict").resolve()}") + print(f"✓ snappyHexMeshDict written to {Path(case/"system"/"snappyHexMeshDict").resolve()}") print(f" ROI surface level : {roi_level}") print(f" Surrounding surface level: {sur_level}") @@ -1792,13 +2296,7 @@ def mesh(gdf): ftp.write_text(transport_properties_write) - if 'computational_domain' in config and 'cells_between_levels' in config['computational_domain']: - try: - nu = float(config['computational_domain']['kinematic_viscosity']) - except (TypeError, ValueError): - raise ValueError("kinematic_viscosity must be a float") - else: - nu = get_input("Kinematic viscosity", "1.5e-05") + side = side_choice @@ -1813,12 +2311,13 @@ def mesh(gdf): inlet=boundary_conditions['inlet'] fw=inlet['framework'] + subm=inlet['subModel'] Uref=float(inlet['Uref']) Href=float(inlet['Href']) z0=float(inlet['z0']) - if fw == "les" or fw == "LES": - fw = "les" + if fw == "les" or fw =="urans": inflow=inlet['inflow'] + les_algorithm=inlet['les_algorithm'] except KeyError as e: raise ValueError(f"Missing key {e} in boundary_conditions: {region}") from e @@ -1826,13 +2325,17 @@ def mesh(gdf): raise ValueError("Uref, Href, z0 must be floats") else: - print(" constant/transportProperties written.") + print("✓ constant/transportProperties written.") while True: - fw = input("Framework? [RANS / LES]: ").strip().lower() - if fw in ("rans", "les"): + fw = input("Framework? [RANS / LES / URANS]: ").strip().lower() + if fw in ("rans", "les", "urans"): break if fw == "les": + while True: + subm = input("SGS Model? [SMAGORINSKY/KEQN/DYNKEQN/WALE]: ").strip().lower() + if subm in ("smagorinsky", "keqn", "dynkeqn", "wale"): + break # meanABL or turbulent inflow? inflow = ask("LES inlet type {meanABL|turbulent}", "meanABL").lower() while inflow not in ("meanabl", "turbulent"): @@ -1850,15 +2353,44 @@ def mesh(gdf): while surround_style not in ("rough", "smooth"): surround_style = ask(" choose rough/smooth", "smooth").lower() - Uref = ask("Reference wind speed Uref (m/s)", "10") - Href = ask("Reference height Zref (m)", "10") - z0 = ask("Roughness length z0 (m)", "0.1") + Uref = float(ask("Reference wind speed Uref (m/s)", "10")) + Href = float(ask("Reference height Zref (m)", "10")) + z0 = float(ask("Roughness length z0 (m)", "0.1")) + + elif fw == "urans": + while True: + subm = input("Turbulence Model? [KEPSILON/KOMEGA/KOMEGASSTSAS]: ").strip().lower() + if subm in ("kepsilon", "komega", "komegasstsas"): + break + # meanABL or turbulent inflow? + inflow = ask("URANS inlet type {meanABL|turbulent}", "meanABL").lower() + while inflow not in ("meanabl", "turbulent"): + inflow = ask(" choose meanABL or turbulent", "meanABL").lower() + + ground_style = ask("Ground wall function {rough|smooth}", "smooth").lower() + while ground_style not in ("rough", "smooth"): + ground_style = ask(" choose rough/smooth", "smooth").lower() + + roi_style = ask("ROI wall function {rough|smooth}", "smooth").lower() + while roi_style not in ("rough", "smooth"): + roi_style = ask(" choose rough/smooth", "smooth").lower() + + surround_style = ask("Surrounding wall function {rough|smooth}", "smooth").lower() + while surround_style not in ("rough", "smooth"): + surround_style = ask(" choose rough/smooth", "smooth").lower() + + Uref = float(ask("Reference wind speed Uref (m/s)", "10")) + Href = float(ask("Reference height Zref (m)", "10")) + z0 = float(ask("Roughness length z0 (m)", "0.1")) else: - - Uref = ask("Reference wind speed Uref (m/s)", "10") - Href = ask("Reference height Zref (m)", "10") - z0 = ask("Roughness length z0 (m)", "0.1") + while True: + subm = input("Turbulence Model? [KEPSILON/KOMEGA/KOMEGASST]: ").strip().lower() + if subm in ("kepsilon", "komega", "komegasst"): + break + Uref = float(ask("Reference wind speed Uref (m/s)", "10")) + Href = float(ask("Reference height Zref (m)", "10")) + z0 = float(ask("Roughness length z0 (m)", "0.1")) side = side_choice @@ -1878,8 +2410,19 @@ def mesh(gdf): # write turbulenceProperties fld2.parent.mkdir(parents=True, exist_ok=True) - fld2.write_text(TP_LES) - print(" turbulenceProperties (LES) written.") + if subm == "smagorinsky": + fld2.write_text(TP_LES) + + elif subm == "keqn": + fld2.write_text(TP_LESKeqn) + + elif subm == "dynkeqn": + fld2.write_text(TP_LESDKeqn) + + else: + fld2.write_text(TP_LESWale) + + print("✓ turbulenceProperties (LES) written.") fld1 = Path(case/"0") fld1.mkdir(parents=True, exist_ok=True) @@ -1898,15 +2441,72 @@ def mesh(gdf): P_BODY % (SIDE_MAP[side], SIDE_MAP[side]) ) - print(f" fields written to {fld1.resolve()}") + if subm == "keqn" or subm == "dynkeqn": + fld1.joinpath("k").write_text( + body_ksgs(SIDE_MAP[side])) + + print(f"✓ fields written to {fld1.resolve()}") #return # LES path ends here + elif fw == 'urans': + + fld2.parent.mkdir(parents=True, exist_ok=True) + if subm == "kepsilon": + fld2.write_text(TP_RANS) + + elif subm == "komega": + fld2.write_text(TP_RANSkw) + + else: + fld2.write_text(TP_RANSkwSSTSAS) + + print("✓ turbulenceProperties (RANS) written.") + + fld1 = Path(case/"0") + fld1.mkdir(parents=True, exist_ok=True) + + if inflow == "meanabl": + Ubody = body_U_meanABL(SIDE_MAP[side], Uref, Href, z0) + else: + Ubody = body_U_DFM(SIDE_MAP[side], Uref) + + (fld1 / "U").write_text(Ubody) + + fld1.joinpath("k").write_text( + body_k(SIDE_MAP[side], Uref, Href, z0)) + + if subm == "kepsilon": + fld1.joinpath("epsilon").write_text( + body_eps(SIDE_MAP[side], Uref, Href, z0)) + + else: + fld1.joinpath("omega").write_text( + body_omega(SIDE_MAP[side],Uref,Href,z0)) + + fld1.joinpath("nut").write_text( + body_nut(SIDE_MAP[side], ground_style, z0,Uref,Href, roi_style, surround_style)) + + fld1.joinpath("p").write_text( + P_BODY % (SIDE_MAP[side], SIDE_MAP[side]) + ) + + print(f"✓ fields written to {fld1.resolve()}") + else: # ───────────── RANS branch ───────────── fld2.parent.mkdir(parents=True, exist_ok=True) - fld2.write_text(TP_RANS) - print(" turbulenceProperties (RANS) written.") + if subm == "kepsilon": + fld2.write_text(TP_RANS) + + elif subm == "komega": + fld2.write_text(TP_RANSkw) + + else: + fld2.write_text(TP_RANSkwSST) + + + print("✓ turbulenceProperties (RANS) written.") fld1 = Path(case/"0") fld1.mkdir(parents=True, exist_ok=True) @@ -1917,8 +2517,13 @@ def mesh(gdf): fld1.joinpath("k").write_text( body_k(SIDE_MAP[side], Uref, Href, z0)) - fld1.joinpath("epsilon").write_text( - body_eps(SIDE_MAP[side], Uref, Href, z0)) + if subm == "kepsilon": + fld1.joinpath("epsilon").write_text( + body_eps(SIDE_MAP[side], Uref, Href, z0)) + + else: + fld1.joinpath("omega").write_text( + body_omega(SIDE_MAP[side],Uref,Href,z0)) fld1.joinpath("nut").write_text( body_nut(SIDE_MAP[side], ground_style, z0,Uref,Href, roi_style, surround_style)) @@ -1927,13 +2532,13 @@ def mesh(gdf): P_BODY % (SIDE_MAP[side], SIDE_MAP[side]) ) - print(f" fields written to {fld1.resolve()}") + print(f"✓ fields written to {fld1.resolve()}") # ───────────────────────── Inputs for ControlDict ───────────────────────── lib_TINF = "" - if fw == "les": + if fw == "les" or fw == "urans": if inflow == "turbulent": lib_TINF = '"libturbulentInflow.so"' @@ -1945,8 +2550,7 @@ def mesh(gdf): deltaT_sim=float(control_dict['initial_deltaT_sim']) maxDeltaT = float(control_dict['max_deltaT_sim']) adjust_time=control_dict['adjust_time'] - deltaT_write=float(control_dict['deltaT_write']) - les_algorithm=control_dict['solver'] + deltaT_write=float(control_dict['deltaT_write']) maxCo = float(control_dict['max_courant']) n_profile = int(control_dict['num_wind_profiles']) n_plane = int(control_dict['num_section_planes']) @@ -1984,17 +2588,127 @@ def mesh(gdf): lib_TINF = lib_TINF, functions = functions ) + Path(case/"system"/"controlDict").parent.mkdir(parents=True, exist_ok=True) Path(case/"system"/"controlDict").write_text(les_controldict) - Path(case/"system"/"fvSolution").parent.mkdir(parents=True, exist_ok=True) - Path(case/"system"/"fvSolution").write_text(TP_fvSol_LES) - Path(case/"system"/"fvSchemes").parent.mkdir(parents=True, exist_ok=True) - Path(case/"system"/"fvSchemes").write_text(TP_fvSch_LES) - print(f" system/controlDict written to {Path(case/"system"/"controlDict").resolve()}") + + if fw == 'urans': + Path(case/"system"/"fvSolution").parent.mkdir(parents=True, exist_ok=True) + Path(case/"system"/"fvSolution").write_text(TP_fvSol_URANS) + Path(case/"system"/"fvSchemes").parent.mkdir(parents=True, exist_ok=True) + Path(case/"system"/"fvSchemes").write_text(TP_fvSch_URANS) + print(f"✓ system/controlDict written to {Path(case/"system"/"controlDict").resolve()}") + else: + Path(case/"system"/"fvSolution").parent.mkdir(parents=True, exist_ok=True) + Path(case/"system"/"fvSolution").write_text(TP_fvSol_LES) + Path(case/"system"/"fvSchemes").parent.mkdir(parents=True, exist_ok=True) + Path(case/"system"/"fvSchemes").write_text(TP_fvSch_LES) + print(f"✓ system/controlDict written to {Path(case/"system"/"controlDict").resolve()}") # write profile and plane recorder - create_profile_txt(n_profile, Path(case/"system"/"Profile")) - create_plane_txt(n_plane, Path(case/"system"/"Plane")) + #create_profile_txt(n_profile, Path(case/"system"/"Profile")) + for i in range(1, n_profile+1): + print(f"\n--- Configuring Profile{i} ---") + if 'computational_domain' in config and 'control_dict' in config['computational_domain']: + control_dict = config['computational_domain']['control_dict'] + + try: + startX=float(control_dict[f"wind_profile{i}_startX"]) + startY=float(control_dict[f"wind_profile{i}_startY"]) + startZ=float(control_dict[f"wind_profile{i}_startZ"]) + endX=float(control_dict[f"wind_profile{i}_endX"]) + endY=float(control_dict[f"wind_profile{i}_endY"]) + endZ=float(control_dict[f"wind_profile{i}_endZ"]) + n_points=int(control_dict[f"number_points{i}"]) + start = (startX, startY, startZ) + end = (endX, endY, endZ) + N_profile=int(control_dict[f"Write_Interval{i}"]) + fields = control_dict[f"Fields{i}"] + t_start = float(control_dict[f"Start_Time{i}"]) + + except KeyError as e: + raise ValueError(f"Missing key {e} in control_dict") from e + except (TypeError, ValueError): + raise ValueError("float (time quantities and courant number) or int expected") + + else: + start = tuple(map(float, get_input(" Start point (x y z)", "0 0 0").split())) + end = tuple(map(float, get_input(" End point (x y z)", "0 0 0").split())) + n_points = int(get_input(" Number of points along the probe line", "5")) + fields = get_input("Field write {U or p or U p}", "U") + while fields not in FIELD_MAP: + fields = get_input(" -> Please choose U or p or U p", "U") + N_profile = get_input("Field write interval", "10") + t_start = get_input(" Time start", "0") + + # generate probe locations + points = generate_line_points(start, end, n_points) + + # fill template + profile_text = TP_PROFILE.format( + ProfileName=f"Profile{i}", + N_profile=N_profile, + t_start=t_start, + fields=fields, + points=points + ) + + out_path = case/"system"/f"Profile{i}" + out_path.write_text(profile_text) + print(f"✓ Profile written to {out_path.resolve()}") + + #create_plane_txt(n_plane, Path(case/"system"/"Plane")) + for i in range(1, n_plane+1): + print(f"\n--- Configuring Plane{i} ---") + + if 'computational_domain' in config and 'control_dict' in config['computational_domain']: + control_dict = config['computational_domain']['control_dict'] + + try: + plane_pointX=float(control_dict[f"section{i}_pointX"]) + plane_pointY=float(control_dict[f"section{i}_pointY"]) + plane_pointZ=float(control_dict[f"section{i}_pointZ"]) + plane_normalX=float(control_dict[f"section{i}_NormX"]) + plane_normalY=float(control_dict[f"section{i}_NormY"]) + plane_normalZ=float(control_dict[f"section{i}_NormZ"]) + N_plane=int(control_dict[f"Write_Interval_plane{i}"]) + plane_point1 = (plane_pointX, plane_pointY, plane_pointZ) + plane_normal1 = (plane_normalX, plane_normalY, plane_normalZ) + plane_point = "(" + " ".join(map(str, plane_point1)) + ")" + plane_normal = "(" + " ".join(map(str, plane_normal1)) + ")" + t_end=int(control_dict[f"End_Time_plane{i}"]) + fields = control_dict[f"Fields_plane{i}"] + t_start = float(control_dict[f"Start_Time_plane{i}"]) + + except KeyError as e: + raise ValueError(f"Missing key {e} in control_dict") from e + except (TypeError, ValueError): + raise ValueError("float (time quantities and courant number) or int expected") + + else: + + N_plane = get_input("Plane write interval", "10") + t_start = get_input(" Time start", "0.000000") + t_end = get_input(" Time end", "10.000000") + fields = get_input("Field write {U or p or U p}", "U") + while fields not in FIELD_MAP: + fields = get_input(" -> Please choose U or p or U p", "U") + plane_point = "(" + " ".join(get_input(" Point in plane (x y z)", "0 0 0").split()) + ")" + plane_normal = "(" + " ".join(get_input(" Normal vector to plane (x y z)", "0 0 0").split()) + ")" + # fill template + plane_text = TP_PLANE.format( + PlaneName=f"Plane{i}", + N_plane=N_plane, + t_start=t_start, + t_end=t_end, + fields=fields, + plane_point=plane_point, + plane_normal=plane_normal + ) + + out_path = case/"system"/f"Plane{i}" + out_path.write_text(plane_text) + print(f"✓ Plane written to {out_path.resolve()}") else: # Control dict if RANS @@ -2028,7 +2742,7 @@ def mesh(gdf): Path(case/"system"/"fvSolution").write_text(TP_fvSol_RANS) Path(case/"system"/"fvSchemes").parent.mkdir(parents=True, exist_ok=True) Path(case/"system"/"fvSchemes").write_text(TP_fvSch_RANS) - print(f" system/controlDict written to {Path(case/"system"/"controlDict").resolve()}") + print(f"✓ system/controlDict written to {Path(case/"system"/"controlDict").resolve()}") if 'number_of_processors' in config: @@ -2074,12 +2788,12 @@ class dictionary; outd = Path(case/"system"/"decomposeParDict") outd.parent.mkdir(parents=True, exist_ok=True) outd.write_text(DECOMP) - print(f" decomposeParDict written to {outd.resolve()}") + print(f"✓ decomposeParDict written to {outd.resolve()}") print(f" ( {nproc} subdomains, method = scotch )") # ───────────────────────── Get TINF file ───────────────────────── - if fw == "les": + if fw == "les" or fw == "urans": if inflow == "turbulent": if 'computational_domain' in config and 'boundary_conditions' in config['computational_domain']: @@ -2135,24 +2849,23 @@ def write_list(path: Path, iterable, fmt): else: f.write(f"(0 0 {z:g})\n") f.write(")\n;\n") - print(f" points → {pts_out.resolve()}") + print(f"✓ points → {pts_out.resolve()}") # U write_list(u_out, u_vals, lambda u: f"{u:g}") - print(f" U → {u_out.resolve()}") + print(f"✓ U → {u_out.resolve()}") # R write_list(r_out, r_vals.itertuples(index=False), lambda row: "(" + " ".join(f"{v:g}" for v in row) + ")") - print(f" R → {r_out.resolve()}") + print(f"✓ R → {r_out.resolve()}") # L write_list(l_out, l_vals.itertuples(index=False), lambda row: "(" + " ".join(f"{v:g}" for v in row) + ")") - print(f" L → {l_out.resolve()}") + print(f"✓ L → {l_out.resolve()}") Path(case/"Community.foam").touch() - print("Done .. OpenFOAM Files Created") if __name__ == "__main__": From 029f2092d2a9fff9ad9dc9cda29b42b8fb3d0cfd Mon Sep 17 00:00:00 2001 From: tpvora-lgtm Date: Wed, 14 Jan 2026 10:43:56 -0500 Subject: [PATCH 2/4] Updateinput.json --- .../advancedCFDWithBRAILS/input.json | 164 +++++++++--------- 1 file changed, 86 insertions(+), 78 deletions(-) diff --git a/modules/createEVENT/advancedCFDWithBRAILS/input.json b/modules/createEVENT/advancedCFDWithBRAILS/input.json index 1c517eb22..0d783a337 100644 --- a/modules/createEVENT/advancedCFDWithBRAILS/input.json +++ b/modules/createEVENT/advancedCFDWithBRAILS/input.json @@ -1,62 +1,51 @@ { - "case_folder":"LESCase_meanABL", + "case_folder":"URANSCaseKwSST", "wind_direction":225.0, "number_of_processors":10, "geographic_extent":{ - "larger_region": { - "lat": 34.19707659182189, - "lon": -118.14252114105332, - "radius": 500.0 - }, - "region_of_interest": { - "min_lon": -118.14636206427565, - "min_lat": 34.196367, - "max_lon": -118.138466, - "max_lat": 34.197378 - } + "larger_region": { + "lat": 34.187958, + "lon": -118.141656, + "radius": 200.0 + }, + "region_of_interest": { + "min_lon": -118.143614, + "min_lat": 34.187494, + "max_lon": -118.139940, + "max_lat": 34.188312 + } }, "brails_options":{ "scraper":"USA", "default_building_height":20.0 }, "computational_domain": { - "roi_surface_level":5.0, - "surrounding_surface_level":4.0, - "boundary_mesh_cell_size":5.0, + "roi_surface_level":5, + "surrounding_surface_level":4, + "boundary_mesh_cell_size":14.0, "kinematic_viscosity":1.5e-05, "cells_between_levels":5, "domain_extents": { - "inlet_multiplier":7.5, - "outlet_multiplier":20.0, - "side_multiplier":10.0, - "top_multiplier":20.0 + "inlet_multiplier":5, + "outlet_multiplier":15.0, + "side_multiplier":5, + "top_multiplier":15.0 }, "boundary_conditions": { "side":"slip", - "ground_style":"rough", + "ground_style":"smooth", "roi_style":"rough", "surround_style":"rough", - "inlet":{ - "framework":"les", - "inflow":"meanabl", - "Uref":10.0, - "Href":10.0, - "z0":0.1 - }, - "inletLT":{ - "framework":"les", - "inflow":"turbulent", - "path_TINF_file":"wind_profile.csv", - "Uref":10.0, - "Href":10.0, - "z0":0.1 - }, - "inletR":{ - "framework":"RANS", - "Uref":20.0, - "Href":50.0, - "z0":1.0 - } + "inlet": { + "framework": "urans", + "subModel" : "komegasstsas", + "les_algorithm": "pimpleFoam", + "inflow": "turbulent", + "path_TINF_file": "wind_profile.csv", + "Uref": 20.0, + "Href": 100.0, + "z0": 1.0 + } }, "refinement_regions":[ {"name":"box1", @@ -64,45 +53,64 @@ "x_min":0, "y_min":0, "z_min":0, - "x_max":390, - "y_max":345, - "z_max":50 - }, - {"name":"box2", - "level":2, - "x_min":0, - "y_min":0, - "z_min":0, - "x_max":300, - "y_max":300, - "z_max":30 + "x_max":548, + "y_max":475.6, + "z_max":80 }, - {"name":"box3", - "level":3, - "x_min":50, - "y_min":50, - "z_min":0, - "x_max":250, - "y_max":250, - "z_max":15 - } + { + "name": "box2", + "level": 2, + "x_min": 0, + "y_min": 0, + "z_min": 0, + "x_max": 548, + "y_max": 475.6, + "z_max": 60 + }, + { + "name": "box3", + "level": 3, + "x_min": 0, + "y_min": 0, + "z_min": 0, + "x_max": 548, + "y_max": 475.6, + "z_max": 40 + } ], - "control_dictR": { - "end_time":10000.0, - "deltaT_sim":1.0, - "deltaT_write":1.0 - }, - "control_dict": { - "end_time":100.0, - "initial_deltaT_sim":0.05, - "max_deltaT_sim":0.01, - "adjust_time":"yes", - "solver":"pisoFoam", - "max_courant":1.0, - "deltaT_write":1.0, - "num_wind_profiles":0, - "num_section_planes":0 - } + + "control_dict": { + "end_time": 1000.0, + "initial_deltaT_sim": 0.005, + "deltaT_sim": 1.0, + "max_deltaT_sim": 0.5, + "adjust_time": "yes", + "max_courant": 2.0, + "deltaT_write": 10.0, + "num_wind_profiles": 1, + "num_section_planes": 1, + "wind_profile1_startX": 30, + "wind_profile1_startY": 237.5, + "wind_profile1_startZ": 0, + "wind_profile1_endX": 30, + "wind_profile1_endY": 237.5, + "wind_profile1_endZ": 109.5, + "number_points1": 15, + "Write_Interval1": 1, + "Fields1": "U p", + "Start_Time1": 0, + + "section1_pointX": 100, + "section1_pointY": 237.5, + "section1_pointZ": 50, + "section1_NormX": 0, + "section1_NormY": 1, + "section1_NormZ": 0, + "Write_Interval_plane1": 1, + "Fields_plane1": "U", + "Start_Time_plane1": 0, + "End_Time_plane1": 500 + } } } From 86783111ecd67fe81c85d41fde1ee963e583aa29 Mon Sep 17 00:00:00 2001 From: tpvora-lgtm Date: Wed, 14 Jan 2026 10:56:27 -0500 Subject: [PATCH 3/4] Delete modules/createEVENT/advancedCFDWithBRAILS/wind_profile.csv --- .../advancedCFDWithBRAILS/wind_profile.csv | 66 ------------------- 1 file changed, 66 deletions(-) delete mode 100644 modules/createEVENT/advancedCFDWithBRAILS/wind_profile.csv diff --git a/modules/createEVENT/advancedCFDWithBRAILS/wind_profile.csv b/modules/createEVENT/advancedCFDWithBRAILS/wind_profile.csv deleted file mode 100644 index fada9d7bb..000000000 --- a/modules/createEVENT/advancedCFDWithBRAILS/wind_profile.csv +++ /dev/null @@ -1,66 +0,0 @@ -0.00100,2.91947,2.15818,0.00000,-0.35806,0.24952,0.00000,0.08626,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.00250,3.50663,3.11359,0.00000,-0.35804,0.35998,0.00000,0.12444,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.00750,4.36830,4.83177,0.00000,-0.35795,0.55863,0.00000,0.19312,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.01250,4.83820,5.92719,0.00000,-0.35786,0.68528,0.00000,0.23690,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.01750,5.17500,6.78113,0.00000,-0.35777,0.78401,0.00000,0.27103,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.02250,5.44173,7.46841,0.00000,-0.35769,0.86387,0.00000,0.29850,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.02750,5.66457,8.00900,0.00000,-0.35760,0.92623,0.00000,0.32023,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.03250,5.85703,8.48043,0.00000,-0.35751,0.97978,0.00000,0.33894,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.03750,6.02710,9.01621,0.00000,-0.35743,1.04242,0.00000,0.36036,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.04250,6.17987,9.50191,0.00000,-0.35734,1.09852,0.00000,0.38038,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.04750,6.31887,9.86259,0.00000,-0.35725,1.14039,0.00000,0.39450,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.05250,6.44663,10.19124,0.00000,-0.35716,1.17716,0.00000,0.40732,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.05750,6.56500,10.91317,0.00000,-0.35708,1.26174,0.00000,0.43618,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.06250,6.67540,11.49053,0.00000,-0.35699,1.32751,0.00000,0.45908,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.06750,6.77893,11.51607,0.00000,-0.35690,1.33120,0.00000,0.46046,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.07250,6.87653,11.47435,0.00000,-0.35682,1.32669,0.00000,0.45879,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.07750,6.96887,11.30157,0.00000,-0.35673,1.30621,0.00000,0.45225,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.08250,7.05653,11.30125,0.00000,-0.35664,1.30681,0.00000,0.45224,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.08800,7.14823,11.90069,0.00000,-0.35655,1.37599,0.00000,0.47583,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.09250,7.21987,12.36278,0.00000,-0.35647,1.42948,0.00000,0.49451,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.09750,7.29630,12.62593,0.00000,-0.35638,1.45991,0.00000,0.50504,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.10000,7.33333,12.76490,0.00000,-0.35634,1.47477,0.00000,0.51018,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.10750,7.44017,13.15032,0.00000,-0.35621,1.51988,0.00000,0.52623,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.11250,7.50813,13.41367,0.00000,-0.35612,1.54965,0.00000,0.53589,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.12250,7.63710,13.90121,0.00000,-0.35595,1.60721,0.00000,0.55559,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.13250,7.75790,14.37973,0.00000,-0.35577,1.66246,0.00000,0.57566,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.14250,7.87163,14.80444,0.00000,-0.35560,1.71156,0.00000,0.59266,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.15250,7.97913,14.87732,0.00000,-0.35542,1.72074,0.00000,0.59534,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.16250,8.08113,14.92108,0.00000,-0.35525,1.72445,0.00000,0.59684,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.17250,8.17823,14.95113,0.00000,-0.35508,1.72723,0.00000,0.59729,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.18250,8.27093,14.94467,0.00000,-0.35490,1.72726,0.00000,0.59804,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.19250,8.35963,14.91621,0.00000,-0.35473,1.72475,0.00000,0.59665,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.20250,8.44473,14.88072,0.00000,-0.35456,1.71995,0.00000,0.59575,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.21250,8.52653,14.99820,0.00000,-0.35438,1.73316,0.00000,0.59940,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.23250,8.68133,15.19377,0.00000,-0.35403,1.75502,0.00000,0.60775,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.25250,8.82580,15.32820,0.00000,-0.35369,1.77138,0.00000,0.61285,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.27250,8.96137,15.43439,0.00000,-0.35334,1.78527,0.00000,0.61766,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.29250,9.08923,15.50356,0.00000,-0.35299,1.79250,0.00000,0.61957,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.31250,9.21027,15.56838,0.00000,-0.35265,1.79832,0.00000,0.62303,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.33250,9.32523,15.63332,0.00000,-0.35230,1.80571,0.00000,0.62533,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.35250,9.43480,15.67243,0.00000,-0.35196,1.81011,0.00000,0.62660,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.37250,9.53953,15.68805,0.00000,-0.35161,1.81179,0.00000,0.62692,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.39250,9.63983,15.68194,0.00000,-0.35126,1.81356,0.00000,0.62636,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.41250,9.73613,15.54831,0.00000,-0.35092,1.79738,0.00000,0.62193,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.43250,9.82877,15.30256,0.00000,-0.35057,1.77107,0.00000,0.61210,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.45250,9.91803,15.05389,0.00000,-0.35023,1.74002,0.00000,0.60308,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.47250,10.00420,14.78875,0.00000,-0.34988,1.70968,0.00000,0.59186,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.49250,10.08747,14.50869,0.00000,-0.34954,1.67762,0.00000,0.58004,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.54250,10.08747,14.27907,0.00000,-0.34868,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.59250,10.08747,14.27907,0.00000,-0.34782,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.64250,10.08747,14.27907,0.00000,-0.34696,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.69250,10.08747,14.27907,0.00000,-0.34610,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.74250,10.08747,14.27907,0.00000,-0.34524,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.79250,10.08747,14.27907,0.00000,-0.34439,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.84250,10.08747,14.27907,0.00000,-0.34353,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.89250,10.08747,14.27907,0.00000,-0.34268,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -0.94250,10.08747,14.27907,0.00000,-0.34182,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -1.04250,10.08747,14.27907,0.00000,-0.34012,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -1.14250,10.08747,14.27907,0.00000,-0.33842,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -1.24250,10.08747,14.27907,0.00000,-0.33673,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -1.34250,10.08747,14.27907,0.00000,-0.33504,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -1.44250,10.08747,14.27907,0.00000,-0.33335,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -1.54250,10.08747,14.27907,0.00000,-0.33167,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -1.64250,10.08747,14.27907,0.00000,-0.32999,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -1.74250,10.08747,14.27907,0.00000,-0.32832,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 -1.80000,10.08747,14.27907,0.00000,-0.32736,1.65159,0.00000,0.57086,0.55224,0.14858,0.08855,0.13104,0.14164,0.04202,0.04594,0.02483,0.02947 From 2432182ca844c5cfa802fa82915a18dd9941e70e Mon Sep 17 00:00:00 2001 From: tpvora-lgtm Date: Wed, 14 Jan 2026 10:59:03 -0500 Subject: [PATCH 4/4] Add files via upload --- .../advancedCFDWithBRAILS/wind_profile.csv | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 modules/createEVENT/advancedCFDWithBRAILS/wind_profile.csv diff --git a/modules/createEVENT/advancedCFDWithBRAILS/wind_profile.csv b/modules/createEVENT/advancedCFDWithBRAILS/wind_profile.csv new file mode 100644 index 000000000..6e830414c --- /dev/null +++ b/modules/createEVENT/advancedCFDWithBRAILS/wind_profile.csv @@ -0,0 +1,50 @@ +2.19,5.027134549,8.431631571,0,-3.719837458,3.719837458,0,4.215815785,6.02765016,2.109677556,3.315207588,3.01382508,1.054838778,1.657603794,1.808295048,0.632903267,0.994562276 +4.38,7.292196837,11.85737152,0,-5.231193316,5.231193316,0,5.928685758,7.594363318,2.658027161,4.176899825,3.797181659,1.329013581,2.088449912,2.278308995,0.797408148,1.253069947 +6.57,8.772161566,13.4754643,0,-5.94505778,5.94505778,0,6.737732151,8.693375853,3.042681549,4.781356719,4.346687927,1.521340774,2.39067836,2.608012756,0.912804465,1.434407016 +8.76,9.87334131,14.41163767,0,-6.358075442,6.358075442,0,7.205818834,9.568298205,3.348904372,5.262564013,4.784149103,1.674452186,2.631282006,2.870489462,1.004671312,1.578769204 +10.95,10.75064228,15.02094256,0,-6.626886426,6.626886426,0,7.510471282,10.30713679,3.607497876,5.668925234,5.153568394,1.803748938,2.834462617,3.092141037,1.082249363,1.70067757 +13.14,11.47989466,15.44886824,0,-6.815677166,6.815677166,0,7.724434121,10.95296723,3.833538531,6.024131978,5.476483616,1.916769266,3.012065989,3.28589017,1.150061559,1.807239593 +15.33,12.10392522,15.76582487,0,-6.955510971,6.955510971,0,7.882912434,11.53047995,4.035667983,6.341763973,5.765239975,2.017833991,3.170881986,3.459143985,1.210700395,1.902529192 +17.52,12.64930455,16.00998764,0,-7.063229842,7.063229842,0,8.004993821,12.05530032,4.219355112,6.630415176,6.02765016,2.109677556,3.315207588,3.616590096,1.265806534,1.989124553 +19.71,13.13365783,16.20383486,0,-7.148750674,7.148750674,0,8.101917431,12.53801759,4.388306156,6.895909674,6.269008795,2.194153078,3.447954837,3.761405277,1.316491847,2.068772902 +21.9,13.5692782,16.36145879,0,-7.218290641,7.218290641,0,8.180729393,12.9861786,4.545162512,7.142398232,6.493089302,2.272581256,3.571199116,3.895853581,1.363548753,2.14271947 +24.09,13.96508185,16.49214085,0,-7.275944491,7.275944491,0,8.246070423,13.40537395,4.691880882,7.372955672,6.702686975,2.345940441,3.686477836,4.021612185,1.407564265,2.211886702 +26.28,14.32774178,16.60224229,0,-7.324518657,7.324518657,0,8.301121144,13.79987397,4.829955891,7.589930686,6.899936987,2.414977946,3.794965343,4.139962192,1.448986767,2.276979206 +28.47,14.6623824,16.69626851,0,-7.366000811,7.366000811,0,8.348134253,14.17302291,4.960558017,7.795162599,7.086511454,2.480279009,3.897581299,4.251906872,1.488167405,2.33854878 +30.66,14.9730245,16.77749962,0,-7.401838069,7.401838069,0,8.388749811,14.5274944,5.084623042,7.990121923,7.263747202,2.542311521,3.995060961,4.358248321,1.525386912,2.397036577 +32.85,15.26288101,16.8483804,0,-7.433109002,7.433109002,0,8.424190202,14.8654636,5.202912262,8.176004983,7.432731802,2.601456131,4.088002491,4.459639081,1.560873679,2.452801495 +35.04,15.53455994,16.91077021,0,-7.460633914,7.460633914,0,8.455385103,15.18872664,5.316054323,8.35379965,7.594363318,2.658027161,4.176899825,4.556617991,1.594816297,2.506139895 +37.23,15.79020729,16.96610827,0,-7.485047766,7.485047766,0,8.483054135,15.49878589,5.424575062,8.52433224,7.749392946,2.712287531,4.26216612,4.649635768,1.627372519,2.557299672 +39.42,16.03161012,17.01552601,0,-7.506849711,7.506849711,0,8.507763006,15.79691228,5.5289193,8.688301756,7.898456142,2.76445965,4.344150878,4.739073685,1.65867579,2.606490527 +41.61,16.26027238,17.05992513,0,-7.526437558,7.526437558,0,8.529962566,16.08419163,5.629467069,8.846305394,8.042095813,2.814733534,4.423152697,4.825257488,1.688840121,2.653891618 +43.8,16.47747176,17.10003309,0,-7.544132245,7.544132245,0,8.550016544,16.36155978,5.726545923,8.99885788,8.180779891,2.863272962,4.49942894,4.908467934,1.717963777,2.699657364 +45.99,16.68430287,17.13644324,0,-7.560195548,7.560195548,0,8.568221621,16.62982975,5.820440414,9.146406364,8.314914877,2.910220207,4.573203182,4.988948926,1.746132124,2.743921909 +48.18,16.88171065,17.16964439,0,-7.574843112,7.574843112,0,8.584822193,16.88971282,5.911399487,9.289342051,8.44485641,2.955699744,4.644671026,5.066913846,1.773419846,2.786802615 +50.37,17.07051649,17.20004282,0,-7.588254184,7.588254184,0,8.600021408,17.14183526,5.99964234,9.428009391,8.570917628,2.99982117,4.714004696,5.142550577,1.799892702,2.828402817 +52.56,17.25143883,17.22797902,0,-7.600578979,7.600578979,0,8.613989509,17.38675171,6.085363097,9.562713439,8.693375853,3.042681549,4.781356719,5.216025512,1.825608929,2.868814032 +54.75,17.42510971,17.25374048,0,-7.611944329,7.611944329,0,8.626870239,17.62495599,6.168734596,9.693725793,8.812477994,3.084367298,4.846862897,5.287486796,1.850620379,2.908117738 +56.94,17.5920881,17.27757161,0,-7.622458063,7.622458063,0,8.638785804,17.8568899,6.249911465,9.821289446,8.928444951,3.124955733,4.910644723,5.35706697,1.87497344,2.946386834 +59.13,17.7528707,17.29968152,0,-7.632212436,7.632212436,0,8.649840761,18.08295048,6.329032668,9.945622764,9.04147524,3.164516334,4.972811382,5.424885144,1.8987098,2.983686829 +61.32,17.90790091,17.32025018,0,-7.641286843,7.641286843,0,8.660125089,18.303496,6.406223601,10.0669228,9.151748001,3.2031118,5.033461401,5.491048801,1.92186708,3.02007684 +63.51,18.05757615,17.3394333,0,-7.649749985,7.649749985,0,8.66971665,18.51885101,6.481597852,10.18536805,9.259425503,3.240798926,5.092684027,5.555655302,1.944479356,3.055610416 +65.7,18.20225405,17.35736631,0,-7.657661609,7.657661609,0,8.678683157,18.72931051,6.555258679,10.30112078,9.364655256,3.27762934,5.150560391,5.618793154,1.966577604,3.090336235 +67.89,18.34225755,17.37416756,0,-7.665073923,7.665073923,0,8.687083779,18.93514359,6.627300257,10.41432898,9.467571796,3.313650129,5.207164488,5.680543078,1.988190077,3.124298693 +70.08,18.47787928,17.38994089,0,-7.672032745,7.672032745,0,8.694970445,19.13659641,6.697808744,10.52512803,9.568298205,3.348904372,5.262564013,5.740978923,2.009342623,3.157538408 +72.27,18.60938521,17.40477784,0,-7.678578457,7.678578457,0,8.702388918,19.33389482,6.766863186,10.63364215,9.666947409,3.383431593,5.316821075,5.800168445,2.030058956,3.190092645 +74.46,18.73701781,17.41875937,0,-7.684746783,7.684746783,0,8.709379687,19.52724659,6.834536307,10.73998563,9.763623296,3.417268154,5.369992813,5.858173978,2.050360892,3.221995688 +76.65,18.86099873,17.4319574,0,-7.690569443,7.690569443,0,8.715978702,19.71684337,6.900895179,10.84426385,9.858421684,3.450447589,5.422131926,5.915053011,2.070268554,3.253279156 +78.84,18.98153114,17.44443599,0,-7.6960747,7.6960747,0,8.722217993,19.90286231,6.966001809,10.94657427,9.951431155,3.483000904,5.473287135,5.970858693,2.089800543,3.283972281 +81.03,19.09880168,17.45625239,0,-7.701287818,7.701287818,0,8.728126194,20.08546758,7.029913652,11.04700717,10.04273379,3.514956826,5.523503584,6.025640273,2.108974096,3.31410215 +83.22,19.21298227,17.46745795,0,-7.706231449,7.706231449,0,8.733728976,20.2648116,7.09268406,11.14564638,10.1324058,3.54634203,5.57282319,6.07944348,2.127805218,3.343693914 +85.41,19.32423156,17.47809885,0,-7.710925963,7.710925963,0,8.739049424,20.4410362,7.154362669,11.24256991,10.2205181,3.577181335,5.621284954,6.132310859,2.146308801,3.372770973 +87.6,19.4326963,17.48821671,0,-7.715389725,7.715389725,0,8.744108355,20.61427358,7.214995752,11.33785047,10.30713679,3.607497876,5.668925234,6.184282073,2.164498726,3.40135514 +89.79,19.5385125,17.49784917,0,-7.71963934,7.71963934,0,8.748924586,20.7846472,7.27462652,11.43155596,10.3923236,3.63731326,5.71577798,6.23539416,2.182387956,3.429466788 +91.98,19.64180642,17.50703035,0,-7.723689858,7.723689858,0,8.753515173,20.95227256,7.333295397,11.52374991,10.47613628,3.666647698,5.761874955,6.285681769,2.199988619,3.457124973 +94.17,19.7426955,17.51579122,0,-7.72755495,7.72755495,0,8.75789561,21.11725788,7.391040258,11.61449183,10.55862894,3.695520129,5.807245917,6.335177364,2.217312077,3.48434755 +96.36,19.84128919,17.52416001,0,-7.731247062,7.731247062,0,8.762080004,21.27970471,7.447896648,11.70383759,10.63985235,3.723948324,5.851918795,6.383911413,2.234368994,3.511151277 +98.55,19.93768962,17.53216246,0,-7.734777554,7.734777554,0,8.766081228,21.4397085,7.503897974,11.79183967,10.71985425,3.751948987,5.895919837,6.431912549,2.251169392,3.537551902 +100.74,20.03199223,17.5398221,0,-7.738156809,7.738156809,0,8.769911051,21.59735907,7.559075676,11.87854749,10.79867954,3.779537838,5.939273745,6.479207722,2.267722703,3.563564247 +102.93,20.1242864,17.54716051,0,-7.741394342,7.741394342,0,8.773580254,21.7527411,7.613459385,11.9640076,10.87637055,3.806729692,5.982003802,6.52582233,2.284037815,3.589202281 +105.12,20.21465589,17.55419747,0,-7.744498885,7.744498885,0,8.777098736,21.90593446,7.667077063,12.04826396,10.95296723,3.833538531,6.024131978,6.571780339,2.300123119,3.614479187 +107.31,20.30317935,17.56095119,0,-7.747478466,7.747478466,0,8.780475595,22.05701465,7.719955127,12.13135806,11.02850732,3.859977564,6.065679028,6.617104395,2.315986538,3.639407417 +109.5,20.38993068,17.56743843,0,-7.750340483,7.750340483,0,8.783719214,22.20605305,7.772118568,12.21332918,11.10302653,3.886059284,6.10666459,6.661815916,2.331635571,3.663998754