Skip to content
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
2 changes: 1 addition & 1 deletion AMR_tidy/dynamicRefineFvMeshNew/multiCritRefinement.C
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void Foam::multiCritRefinement::updateRefinementField()
IOobject::NO_WRITE,
false
)
).subDict("dynamicRefineFvMeshCoeffs")
).subDict("dynamicRefineFvMeshNewCoeffs")
);
scalar globalMaxRefLevel = readScalar(refineDict.lookup("maxRefinement"));

Expand Down
23 changes: 4 additions & 19 deletions AMR_tidy/hexRef/hexRef2/hexRef2.C
Original file line number Diff line number Diff line change
Expand Up @@ -336,23 +336,6 @@ Foam::labelListList Foam::hexRef2::setRefinement
isDivisibleEdge[edgeI] = false;
}

// for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); facei++)
// {
// const label & patchID = mesh_.boundaryMesh().whichPatch(facei);

// if (mesh_.boundaryMesh()[patchID].type() != "empty")
// {
// isDivisibleFace[facei] = false;
// const labelList& fEdges = mesh_.faceEdges(facei);

// forAll(fEdges, i)
// {
// label edgeI = fEdges[i];
// isDivisibleEdge[edgeI] = false;
// }
// }
// }

for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{
isDivisibleFace[facei] = false;
Expand Down Expand Up @@ -898,11 +881,13 @@ Foam::labelListList Foam::hexRef2::setRefinement
face newFace(2);

// maybe need to adjust the point order
DynamicList<label> faceVerts(4);

// DynamicList<label> faceVerts(4);

forAll(f, fp)
{
//maybe need to put inside (but nothing wrong to be put outside)
DynamicList<label> faceVerts(4);

label pointi = f[fp];

label nextpointi = f[f.fcIndex(fp)];
Expand Down
21 changes: 15 additions & 6 deletions applications/solvers/dfHighSpeedFoam/dfHighSpeedFoam.C
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ int main(int argc, char *argv[])
double time_monitor_flow;
double time_monitor_chem;
double time_monitor_Y;
double time_monitor_AMR;
clock_t start, end;

turbulence->validate();
Expand All @@ -69,6 +70,7 @@ int main(int argc, char *argv[])
#include "readFluxScheme.H"

dimensionedScalar v_zero("v_zero", dimVolume/dimTime, 0.0);
dimensionedScalar refCri("refCri", dimensionSet(1, -4, 0, 0, 0), 0.0);

// Courant numbers used to adjust the time-step
scalar CoNum = 0.0;
Expand All @@ -80,22 +82,28 @@ int main(int argc, char *argv[])
{
#include "readTimeControls.H"

tmp<volScalarField> tmagGradP = mag(fvc::grad(p));
volScalarField normalisedGradP
//used for AMR
refCri = max(mag(fvc::grad(rho)));
tmp<volScalarField> tmagGradrho = mag(fvc::grad(rho));
volScalarField normalisedGradrho
(
"normalisedGradP",
tmagGradP()/max(tmagGradP())
"normalisedGradrho",
tmagGradrho()/refCri
);
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
tmagGradP.clear();
normalisedGradrho.writeOpt() = IOobject::AUTO_WRITE;
tmagGradrho.clear();

if (!LTS)
{
#include "setDeltaT.H"
runTime++;

// Do any mesh changes
start = std::clock();
mesh.update();
end = std::clock();
time_monitor_AMR += double(end - start) / double(CLOCKS_PER_SEC);

}

// --- Directed interpolation of primitive fields onto faces
Expand Down Expand Up @@ -234,6 +242,7 @@ int main(int argc, char *argv[])
Info<< "MonitorTime_chem = " << time_monitor_chem << " s" << nl << endl;
Info<< "MonitorTime_Y = " << time_monitor_Y << " s" << nl << endl;
Info<< "MonitorTime_flow = " << time_monitor_flow << " s" << nl << endl;
Info<< "MonitorTime_AMR = " << time_monitor_AMR << " s" << nl << endl;

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ CanteraMechanismFile "H2_Li.xml";
transportModel "UnityLewis";
loadbalancing
{
active false;
//log true;
active true;
log true;
}
odeCoeffs
{}
Expand All @@ -32,9 +32,4 @@ zeroDReactor
{
//cvorcp "UV";
}
loadbalancing
{
active true;
//log true;
}
// ************************************************************************* //
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*--------------------------------*- 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 dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh dynamicRefineFvMeshNew;

multiCritRefinementControls
{
enableMultiCritRefinementControl false;
}

dynamicRefineFvMeshNewCoeffs
{
// How often to refine
refineInterval 1;

// Field to be refinement on
field normalisedGradrho;

// Refine field in between lower..upper
lowerRefineLevel 0.2;
upperRefineLevel 1;

// If value < unrefineLevel unrefine
unrefineLevel 0.2;

// Have slower than 2:1 refinement
nBufferLayers 3;

// Refine cells only up to maxRefinement levels
maxRefinement 3;

// Stop refinement if maxCells reached
maxCells 1000000;

// Flux field and corresponding velocity field. Fluxes on changed
// faces get recalculated by interpolating the velocity. Use 'none'
// on surfaceScalarFields that do not need to be reinterpolated.
correctFluxes
(
(phi none)
//(nHatf none)
//(rhoPhi none)
//(alphaPhi0.water none)
//(ghf none)
(neg none)
(pos none)
);

// Write the refinement level as a volScalarField
dumpLevel true;
}


// ************************************************************************* //
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ FoamFile
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inviscid true;
inviscid false;
// ************************************************************************* //
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ vertices

blocks
(
hex (0 1 2 3 4 5 6 7) (5000 1 1) simpleGrading (1 1 1)
hex (0 1 2 3 4 5 6 7) (625 1 1) simpleGrading (1 1 1)
);

edges
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ FoamFile
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs ("libfieldFunctionObjects.so");
libs (
"libfieldFunctionObjects.so"
"libnewdynamicFvMesh.so"
);

application dfHighSpeedFoam;

Expand All @@ -24,7 +27,7 @@ startTime 0;

stopAt endTime;

endTime 2.4e-4;
endTime 2.2e-4;

deltaT 1e-09;

Expand All @@ -48,7 +51,7 @@ runTimeModifiable true;

adjustTimeStep yes;

maxCo 0.02;
maxCo 0.1;

maxDeltaT 1;

Expand All @@ -58,7 +61,7 @@ functions
{
type fieldMinMax;
libs ("libfieldFunctionObjects.so");
writeControl timeStep; //writeTime;
writeControl writeTime; //timeStep;
fields (p);
}
}
Expand Down
32 changes: 32 additions & 0 deletions examples/dfHighSpeedFoam/oneD_detonationH2/system/decomposeParDict
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*--------------------------------*- 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 dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

numberOfSubdomains 4;

method scotch;

constraints
{
refinementHistory
{
//- Decompose cells such that all cell originating from single cell
// end up on same processor
type refinementHistory;
}
}

// ************************************************************************* //
42 changes: 42 additions & 0 deletions examples/dfHighSpeedFoam/oneD_reactiveShockTube/0_orig/AR
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*--------------------------------*- 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 AR;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField uniform 0.8861;


boundaryField
{
Left
{
type zeroGradient;
}

Right
{
type zeroGradient;
}

empty
{
type empty;
}
}


// ************************************************************************* //
41 changes: 41 additions & 0 deletions examples/dfHighSpeedFoam/oneD_reactiveShockTube/0_orig/H2
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*--------------------------------*- 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 H2;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField uniform 0.01266;


boundaryField
{
Left
{
type zeroGradient;
}

Right
{
type zeroGradient;
}

empty
{
type empty;
}
}

// ************************************************************************* //
Loading