Skip to content

feat: Multiscale preconditioner #3779

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*.swo
*.swn
*.nfs*
*.vscode/*.json
*.vscode/*
*.vscode-codespaces*
*.out
*.core
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" ?>

<Problem>

<Included>
<File name="cube_base.xml"/>
</Included>

<Solvers
gravityVector="{ 0.0, 0.0, 0.0 }">

<SinglePhaseFVM
name="flowSolver"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ region }">
<NonlinearSolverParameters
newtonTol="1e-2"
newtonMaxIter="2"
lineSearchAction="None"
lineSearchMaxCuts="1"
maxTimeStepCuts="1"
maxAllowedResidualNorm="1e99"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1e-8"
krylovMaxIter="500"
preconditionerType="amg"
amgSmootherType="l1sgs"
amgNumSweeps="1"
logLevel="0"/>
</SinglePhaseFVM>

</Solvers>

</Problem>
119 changes: 119 additions & 0 deletions inputFiles/multiscalePreconditioner/singlePhaseFlow/cube_base.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" ?>

<Problem>

<Mesh>
<InternalMesh
name="mesh"
elementTypes="{ C3D8 }"
xCoords="{ 0, 100 }"
yCoords="{ 0, 100 }"
zCoords="{ 0, 100 }"
nx="{ 30 }"
ny="{ 30 }"
nz="{ 30 }"
cellBlockNames="{ hex }"/>
</Mesh>

<Events
maxTime="10.0">

<PeriodicEvent
name="solverApplications"
forceDt="1.0"
target="/Solvers/flowSolver"/>
<PeriodicEvent
name="outputs"
timeFrequency="1.0"
targetExactTimestep="1"
target="/Outputs/vtkOutput"/>
</Events>

<NumericalMethods>
<FiniteVolume>
<TwoPointFluxApproximation
name="singlePhaseTPFA"/>
</FiniteVolume>
</NumericalMethods>

<ElementRegions>
<CellElementRegion
name="region"
cellBlocks="{ hex }"
materialList="{ water, rock }"/>
</ElementRegions>

<Constitutive>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0.0"
compressibility="0.0"
viscosibility="0.0"/>

<CompressibleSolidConstantPermeability
name="rock"
solidModelName="nullSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPermeability"/>

<NullModel
name="nullSolid"/>

<PressurePorosity
name="rockPorosity"
defaultReferencePorosity="0.1"
referencePressure="0.0"
compressibility="0.0"/>

<ConstantPermeability
name="rockPermeability"
permeabilityComponents="{ 1.0e-12, 1.0e-12, 1.0e-12 }"/>
</Constitutive>

<Geometry>
<Box
name="source"
xMin="{ -0.01, -0.01, -0.01 }"
xMax="{ 10.01, 10.01, 10.01 }"/>

<Box
name="sink"
xMin="{ 89.00, 89.00, 89.00 }"
xMax="{ 100.01, 100.01, 100.01 }"/>
</Geometry>

<FieldSpecifications>

<SourceFlux
name="sourceTerm"
objectPath="ElementRegions/region"
scale="-100"
functionName="injectionSchedule"
setNames="{ source }"/>

<SourceFlux
name="sinkTerm"
objectPath="ElementRegions/region"
scale="100"
functionName="injectionSchedule"
setNames="{ sink }"/>

</FieldSpecifications>

<Functions>
<TableFunction
name="injectionSchedule"
inputVarNames="{ time }"
coordinates="{ 0.0, 10.0 }"
values="{ 0.0, 1.0 }"
interpolation="linear"/>
</Functions>

<Outputs>
<VTK
name="vtkOutput"
plotFileRoot="cube_flow"/>
</Outputs>
</Problem>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" ?>

<Problem>

<Included>
<File name="cube_base.xml"/>
</Included>

<Solvers
gravityVector="{ 0.0, 0.0, 0.0 }">

<SinglePhaseFVM
name="flowSolver"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ region }">
<NonlinearSolverParameters
newtonTol="1e-2"
newtonMaxIter="2"
lineSearchAction="None"
lineSearchMaxCuts="1"
maxTimeStepCuts="1"
maxAllowedResidualNorm="1e99"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1e-8"
krylovMaxIter="500"
preconditionerType="multiscale"
logLevel="0">
<Multiscale
basisType="msrsb"
maxLevels="3"
boundarySets="{xneg,xpos,yneg,ypos,zneg,zpos}"
debugLevel="0"
coarseType="direct">
<Smoother
type="l1sgs"
preOrPost="both"
numSweeps="1"/>
<Coarsening
partitionType="cartesian"
ratio="{ 5, 5, 5 }"
maxCoarseDof="2000"/>
<MsRSB
maxIter="100"
tolerance="1e-2"
relaxation="0.6666666666666666"
checkFrequency="5"/>
</Multiscale>
</LinearSolverParameters>
</SinglePhaseFVM>

</Solvers>

</Problem>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" ?>

<Problem>

<Included>
<File name="cube_base.xml"/>
</Included>

<Solvers
gravityVector="{ 0.0, 0.0, 0.0 }">

<SolidMechanicsLagrangianFEM
name="mechSolver"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
logLevel="1"
targetRegions="{ region }">
<LinearSolverParameters
preconditionerType="amg"
amgSmootherType="l1sgs"
amgNumSweeps="1"
logLevel="0"/>
</SolidMechanicsLagrangianFEM>

<SinglePhaseFVM
name="flowSolver"
logLevel="1"
discretization="tpfa"
targetRegions="{ region }">
<LinearSolverParameters
preconditionerType="amg"
amgSmootherType="l1sgs"
amgNumSweeps="1"
logLevel="0"/>
</SinglePhaseFVM>

<SinglePhasePoromechanics
name="poroSolver"
solidSolverName="mechSolver"
flowSolverName="flowSolver"
logLevel="1"
targetRegions="{ region }">
<NonlinearSolverParameters
newtonMaxIter="2"
newtonTol="1.0e-2"
maxTimeStepCuts="1"
lineSearchMaxCuts="0"
maxAllowedResidualNorm="1e99"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1e-8"
krylovMaxIter="500"
preconditionerType="block"
logLevel="0"/>
</SinglePhasePoromechanics>

</Solvers>

</Problem>
Loading
Loading