Skip to content

Commit

Permalink
update flareFGM (#397)
Browse files Browse the repository at this point in the history
* update install document: df-notorch python=3.8

* update flareFGM for 2-phase combustion & 6D table

* SandiaD sample points

* sandiaD test setup

* shared memory space
  • Loading branch information
DongWangChina authored Dec 22, 2023
1 parent 162ebc0 commit 4a1b9cd
Show file tree
Hide file tree
Showing 117 changed files with 2,674 additions and 725 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CPU_inferencce_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
if: github.repository_owner == 'deepmodeling'
container:
image: ubuntu:20.04
options: --shm-size=5g # shared memory size = 5GB
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -46,11 +47,10 @@ jobs:
OMPI_MCA_btl_vader_single_copy_mechanism: none
run:
/bin/bash -c " echo $PWD && ls $PWD
&& wget https://github.com/JX278/DeepFlame-flareFGM-table/raw/main/flareFGM_Table_Download.zip
&& unzip flareFGM_Table_Download.zip
&& wget --content-disposition https://aisquare.oss-us-east-1.aliyuncs.com/data/datasets/14b50df5-dbe9-4f1c-bf58-032b8bc40a20
&& unzip flare_CH4_SandiaD_4D.zip
&& ls $PWD
&& ls flareFGM_Table_Download
&& cp -r flareFGM_Table_Download/SandiaD/flare.tbl examples/dfLowMachFoam/2DSandiaD_flareFGM/
&& cp -r flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/2DSandiaD_flareFGM/
&& git clone https://github.com/intelligent-algorithm-team/intelligent-combustion.git
&& cp -r intelligent-combustion/DeePCK/Model/HE04_Hydrogen_ESH2_GMS_sub_20221101/ mechanisms/ && source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera && source /opt/openfoam7/etc/bashrc
&& . configure.sh --use_pytorch&& source ./bashrc && . install.sh
Expand Down
11 changes: 9 additions & 2 deletions applications/solvers/dfHighSpeedFoam/createFields.H
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,15 @@ volScalarField rhoE
rho*(ea + 0.5*magSqr(U))
);

chemistry->correctThermo();
Info<< "At initial time, min/max(T) = " << min(T).value() << ", " << max(T).value() << endl;
const word combModelName(mesh.objectRegistry::lookupObject<IOdictionary>("combustionProperties").lookup("combustionModel"));
Info << "Combustion Model Name is confirmed as "<< combModelName << endl;


if (combModelName != "flareFGM")
{
chemistry->correctThermo();
Info<< "At initial time, min/max(T) = " << min(T).value() << ", " << max(T).value() << endl;
}

forAll(Y, i)
{
Expand Down
7 changes: 5 additions & 2 deletions applications/solvers/dfLowMachFoam/createFields.H
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ chemistry->setEnergyName("ha");
chemistry->updateEnergy();


chemistry->correctThermo();
Info<< "At initial time, min/max(T) = " << min(T).value() << ", " << max(T).value() << endl;
if (combModelName != "flareFGM")
{
chemistry->correctThermo();
Info<< "At initial time, min/max(T) = " << min(T).value() << ", " << max(T).value() << endl;
}

//for dpdt

Expand Down
40 changes: 24 additions & 16 deletions applications/solvers/dfSprayFoam/createFields.H
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,30 @@ autoPtr<compressible::turbulenceModel> turbulence

const word turbName(mesh.objectRegistry::lookupObject<IOdictionary>("turbulenceProperties").lookup("simulationType"));

Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(p.dimensions()/dimTime, 0)
);

Info<< "Creating reaction model\n" << endl;
autoPtr<CombustionModel<basicThermo>> combustion
(
CombustionModel<basicThermo>::New(thermo, turbulence())
);

const word combModelName(mesh.objectRegistry::lookupObject<IOdictionary>
("combustionProperties").lookup("combustionModel"));
Info << "Combustion Model Name is confirmed as "<< combModelName << endl;


Info<< "end Creating reaction model\n" << endl;
dfChemistryModel<basicThermo>* chemistry = combustion->chemistry();
PtrList<volScalarField>& Y = chemistry->Y();
Expand All @@ -91,23 +110,12 @@ const label inertIndex(chemistry->species()[inertSpecie]);
chemistry->setEnergyName("ha");
chemistry->updateEnergy();

if (combModelName != "flareFGM")
{
chemistry->correctThermo();
Info<< "At initial time, min/max(T) = " << min(T).value() << ", " << max(T).value() << endl;
}

chemistry->correctThermo();
Info<< "At initial time, min/max(T) = " << min(T).value() << ", " << max(T).value() << endl;


Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(p.dimensions()/dimTime, 0)
);

Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
Expand Down
14 changes: 11 additions & 3 deletions applications/solvers/dfSprayFoam/dfSprayFoam.C
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,17 @@ int main(int argc, char *argv[])
while (pimple.loop())
{
#include "UEqn.H"
#include "YEqn.H"
#include "EEqn.H"
chemistry->correctThermo();

if(combModelName!="ESF" && combModelName!="flareFGM" )
{
#include "YEqn.H"
#include "EEqn.H"
chemistry->correctThermo();
}
else
{
combustion->correct();
}
Info<< "T gas min/max " << min(T).value() << ", "
<< max(T).value() << endl;

Expand Down
Binary file removed examples/dfLowMachFoam/2DSandiaD_flareFGM/0/G.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ boundaryField
inletPilot
{
type fixedValue;
value uniform -170863.69815950916;
value uniform -294024.3725;
}

inletAir
Expand Down
11 changes: 4 additions & 7 deletions examples/dfLowMachFoam/2DSandiaD_flareFGM/0/T
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,36 @@ boundaryField
type fixedValue;
value uniform 294;
}

wallOutside
{
type zeroGradient;
}

wallTube
{
type zeroGradient;
}

inletPilot
{
type fixedValue;
value uniform 1880;
}

inletAir
{
type fixedValue;
value uniform 291;
}

outlet
{
type zeroGradient;
}

axis
{
type empty;
}
frontAndBack_pos
{
type wedge;
}

frontAndBack_neg
{
type wedge;
Expand Down
70 changes: 70 additions & 0 deletions examples/dfLowMachFoam/2DSandiaD_flareFGM/0/U
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField uniform (0 0 0.9);

boundaryField
{
wallTube
{
type noSlip;
}

outlet
{
type pressureInletOutletVelocity;
value $internalField;
}

inletPilot
{
type fixedValue;
value uniform (0 0 11.4);
}

inletAir
{
type fixedValue;
value uniform (0 0 0.9);
}

wallOutside
{
type zeroGradient;
}

inletCH4
{
type fixedValue;
value uniform (0 0 49.6);
}

frontAndBack_pos
{
type wedge;
}

frontAndBack_neg
{
type wedge;
}
}


// ************************************************************************* //
Binary file removed examples/dfLowMachFoam/2DSandiaD_flareFGM/0/U.gz
Binary file not shown.
69 changes: 69 additions & 0 deletions examples/dfLowMachFoam/2DSandiaD_flareFGM/0/Ydefault
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object Ydefault;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField uniform 0;

boundaryField
{
wallTube
{
type zeroGradient;
}

outlet
{
type zeroGradient;
}

inletPilot
{
type fixedValue;
value uniform 0;
}

inletAir
{
type fixedValue;
value uniform 0;
}

wallOutside
{
type zeroGradient;
}

inletCH4
{
type fixedValue;
value uniform 0;
}

frontAndBack_pos
{
type wedge;
}

frontAndBack_neg
{
type wedge;
}
}


// ************************************************************************* //
Binary file removed examples/dfLowMachFoam/2DSandiaD_flareFGM/0/Ydefault.gz
Binary file not shown.
Loading

0 comments on commit 4a1b9cd

Please sign in to comment.