-
Notifications
You must be signed in to change notification settings - Fork 101
feat: Add single phase viscosity dependency on temperature #4029
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
dkachuma
wants to merge
3
commits into
develop
Choose a base branch
from
dkachuma/viscosity-thermal-expansion
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
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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
This file contains hidden or 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,183 @@ | ||
| <?xml version="1.0" ?> | ||
|
|
||
| <Problem> | ||
| <Solvers> | ||
| <SinglePhaseFVM | ||
| name="singleFlow" | ||
| logLevel="1" | ||
| discretization="tpfaFlow" | ||
| temperature="0" | ||
| isThermal="1" | ||
| targetRegions="{ region }"> | ||
| <NonlinearSolverParameters | ||
| newtonTol="1.0e-6" | ||
| newtonMaxIter="100"/> | ||
| <LinearSolverParameters | ||
| directParallel="0"/> | ||
| </SinglePhaseFVM> | ||
| </Solvers> | ||
|
|
||
| <NumericalMethods> | ||
| <FiniteVolume> | ||
| <TwoPointFluxApproximation | ||
| name="tpfaFlow"/> | ||
| </FiniteVolume> | ||
| </NumericalMethods> | ||
|
|
||
| <Mesh> | ||
| <InternalMesh | ||
| name="mesh" | ||
| elementTypes="{ C3D8 }" | ||
| xCoords="{ 0, 20 }" | ||
| yCoords="{ 0, 1 }" | ||
| zCoords="{ 0, 1 }" | ||
| nx="{ 20 }" | ||
| ny="{ 1 }" | ||
| nz="{ 1 }" | ||
| cellBlockNames="{ region }"> | ||
| </InternalMesh> | ||
| </Mesh> | ||
|
|
||
| <ElementRegions> | ||
| <CellElementRegion | ||
| name="region" | ||
| cellBlocks="{ region }" | ||
| materialList="{ rock, fluid, thermalCond }"/> | ||
| </ElementRegions> | ||
|
|
||
| <Constitutive> | ||
|
|
||
| <CompressibleSolidConstantPermeability | ||
| name="rock" | ||
| solidModelName="nullSolid" | ||
| porosityModelName="rockPorosity" | ||
| permeabilityModelName="rockPerm" | ||
| solidInternalEnergyModelName="rockInternalEnergy" /> | ||
|
|
||
| <NullModel | ||
| name="nullSolid"/> | ||
|
|
||
| <PressurePorosity | ||
| name="rockPorosity" | ||
| defaultReferencePorosity="0.1" | ||
| referencePressure="0.0" | ||
| compressibility="3.0e-11"/> | ||
|
|
||
| <!-- SPHINX_SolidInternalEnergy_linear --> | ||
| <SolidInternalEnergy | ||
| name="rockInternalEnergy" | ||
| referenceVolumetricHeatCapacity="1.0e6" | ||
| referenceTemperature="0" | ||
| referenceInternalEnergy="0"/> | ||
| <!-- SPHINX_SolidInternalEnergy_linearEnd --> | ||
|
|
||
| <ConstantPermeability | ||
| name="rockPerm" | ||
| permeabilityComponents="{ 1.0e-18, 1.0e-18, 1.0e-18 }"/> | ||
|
|
||
| <!-- SPHINX_ThermalCompressibleSinglePhaseFluid --> | ||
| <ThermalCompressibleSinglePhaseFluid | ||
| name="fluid" | ||
| defaultDensity="1000" | ||
| defaultViscosity="0.001" | ||
| referencePressure="0.0" | ||
| referenceTemperature="293.15" | ||
| compressibility="5e-10" | ||
| thermalExpansionCoeff="3e-4" | ||
| viscosibility="0.0" | ||
| viscosityExpansivity="6.21e-4" | ||
| specificHeatCapacity="1" | ||
| referenceInternalEnergy="0.99"/> | ||
| <!-- SPHINX_ThermalCompressibleSinglePhaseFluidEnd --> | ||
|
|
||
| <!-- SPHINX_SinglePhaseThermalConductivity_linear --> | ||
| <SinglePhaseThermalConductivity | ||
| name="thermalCond" | ||
| defaultThermalConductivityComponents="{ 1.66, 1.66, 1.66 }" | ||
| thermalConductivityGradientComponents="{ 0, 0, 0 }" | ||
| referenceTemperature="293.15" /> | ||
| <!-- SPHINX_SinglePhaseThermalConductivity_linearEnd --> | ||
| </Constitutive> | ||
|
|
||
| <FieldSpecifications> | ||
|
|
||
| <!-- SPHINX_FieldSpecificationImposedPressure --> | ||
| <FieldSpecification | ||
| name="initialPressure" | ||
| initialCondition="1" | ||
| setNames="{ all }" | ||
| objectPath="ElementRegions/region" | ||
| fieldName="pressure" | ||
| scale="0e6"/> | ||
|
|
||
| <FieldSpecification | ||
| name="sinkPressure" | ||
| setNames="{ xpos }" | ||
| objectPath="faceManager" | ||
| fieldName="pressure" | ||
| scale="1e6"/> | ||
|
|
||
| <FieldSpecification | ||
| name="sourcePressure" | ||
| setNames="{ xneg }" | ||
| objectPath="faceManager" | ||
| fieldName="pressure" | ||
| scale="-1e6"/> | ||
| <!-- SPHINX_FieldSpecificationImposedPressureEnd --> | ||
|
|
||
| <!-- SPHINX_FieldSpecificationImposedTemperature --> | ||
| <FieldSpecification | ||
| name="initialTemperature" | ||
| initialCondition="1" | ||
| setNames="{ all }" | ||
| objectPath="ElementRegions/region" | ||
| fieldName="temperature" | ||
| scale="373.15"/> | ||
|
|
||
| <FieldSpecification | ||
| name="sinkTemperature" | ||
| setNames="{ xpos }" | ||
| objectPath="faceManager" | ||
| fieldName="temperature" | ||
| scale="373.15"/> | ||
|
|
||
| <FieldSpecification | ||
| name="sourceTemperature" | ||
| setNames="{ xneg }" | ||
| objectPath="faceManager" | ||
| fieldName="temperature" | ||
| scale="293.15"/> | ||
| <!-- SPHINX_FieldSpecificationImposedTemperatureEnd --> | ||
|
|
||
| </FieldSpecifications> | ||
|
|
||
| <Outputs> | ||
| <VTK | ||
| name="vtkOutput"/> | ||
|
|
||
| <Restart | ||
| name="restartOutput"/> | ||
| </Outputs> | ||
|
|
||
| <Events | ||
| maxTime="8640000"> | ||
|
|
||
| <PeriodicEvent | ||
| name="outputs" | ||
| cycleFrequency="5" | ||
| target="/Outputs/vtkOutput"/> | ||
|
|
||
| <PeriodicEvent | ||
| name="solverApplications" | ||
| beginTime="0" | ||
| maxEventDt="864000" | ||
| target="/Solvers/singleFlow"/> | ||
|
|
||
| <PeriodicEvent | ||
| name="restarts" | ||
| cycleFrequency="5" | ||
| target="/Outputs/restartOutput"/> | ||
|
|
||
| </Events> | ||
|
|
||
| </Problem> |
This file contains hidden or 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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,31 +9,46 @@ Overview | |||||||
|
|
||||||||
| This model represents a compressible single-phase fluid with constant compressibility | ||||||||
| and pressure-dependent viscosity. | ||||||||
| For thermal simulations, the model density and viscosity have a temperature dependency | ||||||||
| expressed as a constant thermal expansion coefficient. | ||||||||
|
Comment on lines
+12
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| These assumptions are valid for slightly compressible fluids, such as water, and some | ||||||||
| types of oil with negligible amounts of dissolved gas. | ||||||||
|
|
||||||||
| Specifically, fluid density is computed as | ||||||||
|
|
||||||||
| .. math:: | ||||||||
| \rho(p) = \rho_0 ( e^{c_\rho(p - p_0)} + e^{\beta_f (T - T_0)} ) | ||||||||
| \rho(p) = \rho_0 e^{c_\rho(p - p_0)} | ||||||||
|
|
||||||||
| where :math:`c_\rho` is compressibility, :math:`p_0` is reference pressure, :math:`\rho_0` is | ||||||||
| density at reference pressure, :math:`\beta_f` is the fluid thermal expansion coefficient, :math:`T_0` is reference temperature. | ||||||||
| for isothermal cases and, | ||||||||
|
|
||||||||
| .. math:: | ||||||||
| \rho(p,T) = \rho_0 e^{c_\rho(p - p_0)} e^{-\beta_\rho (T - T_0)} | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| for thermal cases. | ||||||||
|
|
||||||||
| where :math:`c_\rho` is compressibility, :math:`p_0` is reference pressure, :math:`\rho_0` is the | ||||||||
| density at the reference pressure, :math:`\beta_\rho` is the fluid thermal expansion coefficient, | ||||||||
| :math:`T_0` is reference temperature. | ||||||||
|
|
||||||||
| Similarly, | ||||||||
|
|
||||||||
| .. math:: | ||||||||
| \mu(p) = \mu_0 e^{c_\mu(p - p_0)} | ||||||||
|
|
||||||||
| where :math:`c_\mu` is viscosibility (viscosity compressibility), :math:`\mu_0` is reference viscosity. | ||||||||
| for isothermal cases and, | ||||||||
|
|
||||||||
| Either exponent may be approximated by linear (default) or quadratic terms of Taylor series expansion. | ||||||||
| Currently there is no temperature dependence in the model, although it may be added in future. | ||||||||
| .. math:: | ||||||||
| \mu(p,T) = \mu_0 e^{c_\mu(p - p_0)} e^{-\beta_\mu (T - T_0)} | ||||||||
|
|
||||||||
| for thermal cases. | ||||||||
|
|
||||||||
| where :math:`c_\mu` is viscosibility (viscosity compressibility), :math:`\mu_0` is reference viscosity, | ||||||||
| :math:`\beta_\rho` is the fluid viscosity thermal coefficient. | ||||||||
|
|
||||||||
| Parameters | ||||||||
| ========================= | ||||||||
|
|
||||||||
| The model is represented by ``<CompressibleSinglePhaseFluid>`` node in the input. | ||||||||
| For the isothermal case, the model is represented by ``<CompressibleSinglePhaseFluid>`` node in the input. | ||||||||
|
|
||||||||
| The following attributes are supported: | ||||||||
|
|
||||||||
|
|
@@ -51,4 +66,29 @@ Example | |||||||
| compressibility="1e-19" | ||||||||
| referenceViscosity="0.001" | ||||||||
| viscosibility="0.0"/> | ||||||||
| </Constitutive> | ||||||||
| </Constitutive> | ||||||||
|
|
||||||||
| For the thermal case, the model is represented by ``<ThermalCompressibleSinglePhaseFluid>`` node in the input. | ||||||||
|
|
||||||||
| The following attributes are supported: | ||||||||
|
|
||||||||
| .. include:: /docs/sphinx/datastructure/ThermalCompressibleSinglePhaseFluid.rst | ||||||||
|
|
||||||||
| Example | ||||||||
| ========================= | ||||||||
|
|
||||||||
| .. code-block:: xml | ||||||||
|
|
||||||||
| <Constitutive> | ||||||||
| <ThermalCompressibleSinglePhaseFluid name="fluid" | ||||||||
| defaultDensity="1000" | ||||||||
| defaultViscosity="0.001" | ||||||||
| referencePressure="0.0" | ||||||||
| referenceTemperature="0" | ||||||||
| compressibility="5e-10" | ||||||||
| thermalExpansionCoeff="3e-4" | ||||||||
| viscosibility="0.0" | ||||||||
| viscosityExpansivity="6.21e-4" | ||||||||
| specificHeatCapacity="1" | ||||||||
| referenceInternalEnergy="0.99" /> | ||||||||
| </Constitutive> | ||||||||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
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.