-
Notifications
You must be signed in to change notification settings - Fork 72
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
[WIP] Dissolution of porous media model #391
Open
mdzik
wants to merge
16
commits into
CFD-GO:develop
Choose a base branch
from
mdzik:auto_stokes
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a07e7f1
Add Heun for source term integration
mdzik a34e6de
Merge remote-tracking branch 'upstream/develop' into d2q9_reaction_di…
mdzik 6de0f16
Initial porous/auto model with dissolution [WIP]
mdzik 79e0239
configurable WIP
mdzik 6c6a897
Merge branch 'd2q9_reaction_diffusion_configurable' into auto_stokes
mdzik a5e7314
Working reaction flow-coupling, reaction model-solo needs testing
mdzik 253a804
wip - dissolution solver, buggy
mdzik 7dd5fd3
Fixed Stokes model, works for variable permability. Fixed BCs
mdzik 9ee2374
Pre-tested reaction coupling. Almost ready
mdzik abfdca6
Dissolution seems working
mdzik c30baf5
add reaction limiter
mdzik 60aa3ce
Central collision for ADE
mdzik 1214ded
Fix bb-boundary for reaction coupling
ea296b1
Flow in X or Z and 2D
8104408
Fix reaction in 2d TRT model
4a4a140
Add trapeziod integration for global time stepping in dissolution mod…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,143 @@ | ||
|
||
|
||
|
||
IncludedADREModel = TRUE | ||
|
||
Qname = 'DissolutionReaction_ForImplicitSteadyState' | ||
DREs <- ('PHI') | ||
NumberOfODEs = 0 | ||
Params <- c("LinearReactionRate") | ||
|
||
if (Options$d2q9) { | ||
D3 = FALSE | ||
} else { | ||
D3 = TRUE | ||
D3Q19 = FALSE #For advection solver | ||
} | ||
QIntegrator = 'Heun' | ||
#QIntegrator = 'Trapezoid' | ||
source("../models/reaction/d2q9_reaction_diffusion_system/Dynamics.R") | ||
|
||
if (Options$d2q9) { | ||
x = c(0,1,-1); | ||
P = expand.grid(x=0:2,y=0:2,z=0) | ||
U = expand.grid(x,x,0) | ||
} else { | ||
x = c(0,1,-1); | ||
P = expand.grid(x=0:2,y=0:2,z=0:2) | ||
U = expand.grid(x,x,x) | ||
} | ||
|
||
|
||
|
||
f_sel = rep(TRUE,nrow(U)) | ||
|
||
if (Options$d3q19) { | ||
f_sel = rowSums(abs(U)) < 3 | ||
} | ||
|
||
P=P[f_sel,] | ||
U=U[f_sel,] | ||
fname = paste("f",P$x,P$y,P$z,sep="") | ||
|
||
AddDensity( | ||
name = fname, | ||
dx = U[,1], | ||
dy = U[,2], | ||
dz = U[,3], | ||
comment=paste("density",fname), | ||
group="f" | ||
) | ||
|
||
|
||
|
||
#AddDensity( name="fx", group="Force", parameter=FALSE) | ||
#AddDensity( name="fy", group="Force", parameter=FALSE) | ||
#AddDensity( name="fz", group="Force", parameter=FALSE) | ||
|
||
|
||
AddDensity( name="InitialPorosity", group="Brinkman", parameter=TRUE) | ||
#AddDensity( name="InitialPermability", group="Brinkman", parameter=TRUE) | ||
|
||
AddDensity( name="Porosity", group="Brinkman", parameter=TRUE) | ||
AddDensity( name="Permability", group="Brinkman", parameter=TRUE) | ||
|
||
if (Options$GlobalTrapezoid) { | ||
AddDensity( name="GlobalIntegration_1PreviousStep", group="Brinkman", parameter=TRUE) | ||
AddDensity( name="GlobalIntegration_2PreviousStep", group="Brinkman", parameter=TRUE) | ||
|
||
} | ||
|
||
|
||
AddQuantity(name="P",unit="Pa") | ||
AddQuantity(name="U",unit="m/s",vector=T) | ||
|
||
AddQuantity(name="Porosity",unit="1") | ||
AddQuantity(name="Permability",unit="1/m2") | ||
AddQuantity(name="ReactiveFlux",unit="kg/s") | ||
AddQuantity(name="BrinkmanForce",unit="N/m3",vector=TRUE) | ||
|
||
|
||
AddStage(name="InitFromExternal", load.densities=TRUE, save.fields=TRUE) | ||
AddAction(name="InitFromExternalAction", "InitFromExternal") | ||
|
||
AddStage(name="GlobasPorosityDissolutionTimeStep", load.densities=DensityAll$group == "Brinkman", save.fields=Fields$group == "Brinkman") | ||
AddAction(name="GlobasPorosityDissolutionTimeStepAction", "GlobasPorosityDissolutionTimeStep") | ||
|
||
|
||
AddSetting(name="Viscosity", default=0.16666666, comment='Viscosity') | ||
AddSetting(name="Magic", default=3/16, comment='Magic parameter') | ||
AddSetting(name="Velocity", default="0m/s", comment='Inlet velocity', zonal=TRUE) | ||
AddSetting(name="Pressure", default="0Pa", comment='Inlet pressure', zonal=TRUE) | ||
|
||
AddSetting( name="SolidFluidReactionsRate", default="1", comment='Coefficent between fluid and solid mass flux, with dt ratio', zonal=TRUE) | ||
AddSetting( name="ImpliciteReactionIntegration", default="0", comment='Fixed point implicit solution in terms of DPer/Dt.', zonal=FALSE) | ||
AddSetting( name="KarmanKozenyCoefficient", default="1", comment='Permability = KKC * Porosity^3 / ((1-Porosity)^2+1E-8)', zonal=FALSE) | ||
|
||
AddSetting(name="GalileanCorrection",default=1.,comment='Galilean correction term') | ||
|
||
AddSetting(name="ForceX", default=0, comment='Force force X') | ||
AddSetting(name="ForceY", default=0, comment='Force force Y') | ||
AddSetting(name="ForceZ", default=0, comment='Force force Z') | ||
|
||
AddGlobal(name="Flux", comment='Volume flux') | ||
AddGlobal(name="Concentration", comment='Volume flux') | ||
|
||
AddGlobal(name="PressureLoss", comment='pressure loss') | ||
AddGlobal(name="OutletFlux", comment='pressure loss') | ||
AddGlobal(name="InletFlux", comment='pressure loss') | ||
|
||
# AddNodeType(name="NVelocity", group="BOUNDARY") | ||
# AddNodeType(name="SVelocity", group="BOUNDARY") | ||
# AddNodeType(name="NPressure", group="BOUNDARY") | ||
# AddNodeType(name="SPressure", group="BOUNDARY") | ||
# AddNodeType(name="EPressure", group="BOUNDARY") | ||
# AddNodeType(name="EVelocity", group="BOUNDARY") | ||
AddNodeType(name="Wall", group="BOUNDARY") | ||
if (Options$FlowInX || Options$d2q9) { | ||
AddNodeType(name="WDirichlet", group="BOUNDARY") | ||
AddNodeType(name="ENeuman", group="BOUNDARY") | ||
} | ||
|
||
if (Options$FlowInZ) { | ||
AddNodeType(name="IDirichlet", group="BOUNDARY") | ||
AddNodeType(name="ONeuman", group="BOUNDARY") | ||
} | ||
|
||
for (d in rows(DensityAll)) { | ||
if (Options$FlowInX || Options$d2q9) { AddField( name=d$name, dx=-d$dx-1, dy=-d$dy, dz=-d$dz ) } | ||
if (Options$FlowInZ) { AddField( name=d$name, dx=-d$dx, dy=-d$dy, dz=-d$dz-1 ) } | ||
} | ||
|
||
# AddNodeType(name="WVelocity", group="BOUNDARY") | ||
|
||
# AddNodeType(name="W_PHI_DIRICHLET", group="BOUNDARY") | ||
# AddNodeType(name="E_PHI_DIRICHLET", group="BOUNDARY") | ||
|
||
#for (f in fname) AddField(f,dx=0,dy=0,dz=0) # Make f accessible also in present node (not only streamed) | ||
|
||
|
||
AddNodeType(name="Collision", group="COLLISION") | ||
|
||
AddNodeType(name="Inlet", group="OBJECTIVE") | ||
AddNodeType(name="Outlet", group="OBJECTIVE") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source("../models/reaction/d2q9_reaction_diffusion_system/Dynamics.R")
:-)