-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New service for openFOAM org and com
- Loading branch information
1 parent
4d75ee5
commit f897860
Showing
90 changed files
with
466,487 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# CADdrive OpenFOAM Service | ||
## Openfoam2312 (openfoam.com) | ||
|
||
## With ``docker`` | ||
|
||
To build the docker image: | ||
|
||
```sh | ||
cd <CADdrive>/services/openfoam_com | ||
|
||
docker build --tag "caddrive-openfoam-com" . | ||
``` | ||
|
||
To run the docker image: | ||
|
||
```sh | ||
docker run -p 127.0.0.1:5002:5000 "caddrive-openfoam-com" | ||
``` | ||
|
||
## Without ``docker`` | ||
|
||
To run without docker (to obtain debug output): | ||
|
||
```sh | ||
cd <CADdrive>/services/openfoam_com | ||
|
||
python main.py --debug | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM openfoam/openfoam11-paraview510 | ||
|
||
USER root | ||
|
||
RUN apt-get update && apt-get install python3-pip -y | ||
RUN pip3 install Flask | ||
RUN pip3 install requests_toolbelt | ||
|
||
COPY main.py /root | ||
|
||
WORKDIR /root | ||
|
||
EXPOSE 5000/tcp | ||
|
||
CMD python3 main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[[source]] | ||
url = "https://github.com/ghackenberg/caddrive" | ||
verify_ssl = true | ||
name = "caddrive-openfoam" | ||
|
||
[packages] | ||
flask = "*" | ||
requests-toolbelt = "*" | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.11" |
10 changes: 6 additions & 4 deletions
10
services/openfoam/README.md → services/openfoam_org/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
# CADdrive OpenFOAM Service | ||
|
||
## Openfoam11 (openfoam.org) | ||
|
||
## With ``docker`` | ||
|
||
To build the docker image: | ||
|
||
```sh | ||
cd <CADdrive>/services/openfoam | ||
cd <CADdrive>/services/openfoam_org | ||
|
||
docker build --tag "caddrive-openfoam" . | ||
docker build --tag "caddrive-openfoam-org" . | ||
``` | ||
|
||
To run the docker image: | ||
|
||
```sh | ||
docker run -p 127.0.0.1:5002:5000 "caddrive-openfoam" | ||
docker run -p 127.0.0.1:5002:5000 "caddrive-openfoam-org" | ||
``` | ||
|
||
## Without ``docker`` | ||
|
||
To run without docker (to obtain debug output): | ||
|
||
```sh | ||
cd <CADdrive>/services/openfoam | ||
cd <CADdrive>/services/openfoam_org | ||
|
||
python main.py --debug | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# External dependencies | ||
import os | ||
import sys | ||
|
||
from flask import Flask | ||
|
||
# Ensure folder | ||
if not os.path.exists("./output"): | ||
os.makedirs("./output") | ||
|
||
# Define constants | ||
FLASK_HOST = "0.0.0.0" | ||
FLASK_PORT = 5000 | ||
FLASK_DBUG = sys.argv.count("--debug") > 0 | ||
|
||
OPENFOAM_MSH_CMD = "blockMesh" | ||
OPENFOAM_ICO_CMD = "icoFoam" | ||
|
||
WORKDIR = "./output" | ||
JOBNAME = "job" | ||
|
||
# Create app | ||
APP = Flask(__name__) | ||
|
||
# Register route | ||
@APP.post("/") | ||
def simulate(): | ||
|
||
# Command to mesh the body | ||
ret = os.system(f"{OPENFOAM_MSH_CMD}") | ||
|
||
# Handle error | ||
if ret: | ||
return "blockMesh error", 400 | ||
|
||
# Command to start the simulation | ||
ret = os.system(f"{OPENFOAM_ICO_CMD}") | ||
|
||
# Handle error | ||
if ret: | ||
return "icoFaom error", 400 | ||
|
||
# Send response | ||
return "OK" | ||
|
||
# Run app | ||
APP.run(host=FLASK_HOST, port=FLASK_PORT, debug=FLASK_DBUG) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added
BIN
+14.5 KB
tests/openfoam_org_11/OpenFOAM OpenFOAM-11 master tutorials-incompressibleFluid_cavity.zip
Binary file not shown.
Binary file added
BIN
+32 KB
..._org_11/OpenFOAM OpenFOAM-11 master tutorials-incompressibleFluid_motorBike_motorBike.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 11 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class volVectorField; | ||
object U; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
dimensions [0 1 -1 0 0 0 0]; | ||
|
||
internalField uniform (0 0 0); | ||
|
||
boundaryField | ||
{ | ||
movingWall | ||
{ | ||
type fixedValue; | ||
value uniform (1 0 0); | ||
} | ||
|
||
fixedWalls | ||
{ | ||
type noSlip; | ||
} | ||
|
||
frontAndBack | ||
{ | ||
type empty; | ||
} | ||
} | ||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 11 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class volScalarField; | ||
location "0"; | ||
object epsilon; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
dimensions [0 2 -3 0 0 0 0]; | ||
|
||
internalField uniform 0.00754; | ||
|
||
boundaryField | ||
{ | ||
movingWall | ||
{ | ||
type epsilonWallFunction; | ||
value uniform 0.00754; | ||
} | ||
fixedWalls | ||
{ | ||
type epsilonWallFunction; | ||
value uniform 0.00754; | ||
} | ||
frontAndBack | ||
{ | ||
type empty; | ||
} | ||
} | ||
|
||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 11 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class volScalarField; | ||
location "0"; | ||
object k; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
dimensions [0 2 -2 0 0 0 0]; | ||
|
||
internalField uniform 0.00375; | ||
|
||
boundaryField | ||
{ | ||
movingWall | ||
{ | ||
type kqRWallFunction; | ||
value uniform 0.00375; | ||
} | ||
fixedWalls | ||
{ | ||
type kqRWallFunction; | ||
value uniform 0.00375; | ||
} | ||
frontAndBack | ||
{ | ||
type empty; | ||
} | ||
} | ||
|
||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 11 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class volScalarField; | ||
object nuTilda; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
dimensions [0 2 -1 0 0 0 0]; | ||
|
||
internalField uniform 0; | ||
|
||
boundaryField | ||
{ | ||
movingWall | ||
{ | ||
type zeroGradient; | ||
} | ||
|
||
fixedWalls | ||
{ | ||
type zeroGradient; | ||
} | ||
|
||
frontAndBack | ||
{ | ||
type empty; | ||
} | ||
} | ||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 11 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class volScalarField; | ||
location "0"; | ||
object nut; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
dimensions [0 2 -1 0 0 0 0]; | ||
|
||
internalField uniform 0; | ||
|
||
boundaryField | ||
{ | ||
movingWall | ||
{ | ||
type nutkWallFunction; | ||
value uniform 0; | ||
} | ||
fixedWalls | ||
{ | ||
type nutkWallFunction; | ||
value uniform 0; | ||
} | ||
frontAndBack | ||
{ | ||
type empty; | ||
} | ||
} | ||
|
||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: 11 | ||
\\/ M anipulation | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
format ascii; | ||
class volScalarField; | ||
location "0"; | ||
object omega; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
dimensions [0 0 -1 0 0 0 0]; | ||
|
||
internalField uniform 22.4; | ||
|
||
boundaryField | ||
{ | ||
movingWall | ||
{ | ||
type omegaWallFunction; | ||
value uniform 22.4; | ||
} | ||
fixedWalls | ||
{ | ||
type omegaWallFunction; | ||
value uniform 22.4; | ||
} | ||
frontAndBack | ||
{ | ||
type empty; | ||
} | ||
} | ||
|
||
|
||
// ************************************************************************* // |
Oops, something went wrong.