Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding openfoam #4

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions examples/openfoamAI/ControlSimu/0/U
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "include/initialConditions"

dimensions [0 1 -1 0 0 0 0];

internalField uniform $flowVelocity;

boundaryField
{
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value $internalField;
}

inlet
{
type atmBoundaryLayerInletVelocity;
#include "include/ABLConditions"
}

terrain
{
type uniformFixedValue;
uniformValue (0 0 0);
value uniform (0 0 0);
}

ground
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}

#include "include/sideAndTopPatches"
}


// ************************************************************************* //
56 changes: 56 additions & 0 deletions examples/openfoamAI/ControlSimu/0/epsilon
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -3 0 0 0 0];

#include "include/initialConditions"

internalField uniform $turbulentEpsilon;

boundaryField
{
terrain
{
type epsilonWallFunction;
Cmu 0.09;
kappa 0.4;
E 9.8;
value $internalField;
}

outlet
{
type inletOutlet;
inletValue uniform $turbulentEpsilon;
value $internalField;
}

inlet
{
type atmBoundaryLayerInletEpsilon;
#include "include/ABLConditions"
}

ground
{
type zeroGradient;
}

#include "include/sideAndTopPatches"
}


// ************************************************************************* //
Binary file not shown.
15 changes: 15 additions & 0 deletions examples/openfoamAI/ControlSimu/0/include/ABLConditions
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/

Uref 8.0;
Zref 20;
zDir (0 0 1);
flowDir (1 0 0);
z0 uniform 0.1;
zGround uniform 50.0;
// ************************************************************************* //
15 changes: 15 additions & 0 deletions examples/openfoamAI/ControlSimu/0/include/fixedInlet
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/

inlet
{
type fixedValue;
value $internalField;
}

// ************************************************************************* //
14 changes: 14 additions & 0 deletions examples/openfoamAI/ControlSimu/0/include/initialConditions
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/

flowVelocity (0 0 0);
pressure 0;
turbulentKE 1.3;
turbulentEpsilon 0.01;

// ************************************************************************* //
24 changes: 24 additions & 0 deletions examples/openfoamAI/ControlSimu/0/include/sideAndTopPatches
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/

top
{
type slip;
}

sides
{
type slip;
}

"proc.*"
{
type processor;
}

// ************************************************************************* //
52 changes: 52 additions & 0 deletions examples/openfoamAI/ControlSimu/0/k
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "include/initialConditions"

dimensions [0 2 -2 0 0 0 0];

internalField uniform $turbulentKE;

boundaryField
{
outlet
{
type inletOutlet;
inletValue uniform $turbulentKE;
value $internalField;
}

inlet
{
type atmBoundaryLayerInletK;
#include "include/ABLConditions"
}

terrain
{
type kqRWallFunction;
value uniform 0.0;
}

ground
{
type zeroGradient;
}

#include "include/sideAndTopPatches"
}


// ************************************************************************* //
54 changes: 54 additions & 0 deletions examples/openfoamAI/ControlSimu/0/nut
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -1 0 0 0 0];

internalField uniform 0;

boundaryField
{
#include "include/ABLConditions"

inlet
{
type calculated;
value uniform 0;
}

outlet
{
type calculated;
value uniform 0;
}

terrain
{
type nutkAtmRoughWallFunction;
z0 $z0;
value uniform 0.0;
}

ground
{
type calculated;
value uniform 0;
}

#include "include/sideAndTopPatches"
}


// ************************************************************************* //
48 changes: 48 additions & 0 deletions examples/openfoamAI/ControlSimu/0/p
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "include/initialConditions"

dimensions [0 2 -2 0 0 0 0];

internalField uniform $pressure;

boundaryField
{
inlet
{
type zeroGradient;
}

outlet
{
type uniformFixedValue;
uniformValue constant $pressure;
}

terrain
{
type zeroGradient;
}

ground
{
type zeroGradient;
}

#include "include/sideAndTopPatches"
}

// ************************************************************************* //
10 changes: 10 additions & 0 deletions examples/openfoamAI/ControlSimu/Allclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory

# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions

cleanCase
cleanExplicitFeatures

#------------------------------------------------------------------------------
17 changes: 17 additions & 0 deletions examples/openfoamAI/ControlSimu/Allrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

runApplication blockMesh
runApplication decomposePar -copyZero
runParallel snappyHexMesh -overwrite

runParallel topoSet
runParallel $(getApplication)

runApplication reconstructParMesh -constant
runApplication reconstructPar -constant

#------------------------------------------------------------------------------
Binary file not shown.
Loading
Loading