CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Continuity Equation for multicomponent simulation

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 1 Post By Opaque
  • 1 Post By Opaque
  • 1 Post By Antanas

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 2, 2019, 14:24
Default Continuity Equation for multicomponent simulation
  #1
New Member
 
Lucas
Join Date: May 2019
Posts: 29
Rep Power: 2
lordluan is on a distinguished road
I'm working with a pair of gases (ethanol e air), one of them is adsorbed by a porous medium. The ideia to describe the phenomena is to add a mass source term to the continuity equation by creating a subdomain which englobes the whole porous medium, then in the settings I can add a source term to the continuity equation (as well as others equation like mass fraction to the ethanol that I didn't use). My question is since in the settings of Sources I can only add the source term to the continuity and it seems that I am adding the source term to the global continuity equation. Is there a way to add a source to the continuity equation of the ethanol?
lordluan is offline   Reply With Quote

Old   December 2, 2019, 16:45
Default
  #2
Senior Member
 
Join Date: Jun 2009
Posts: 1,065
Rep Power: 22
Opaque will become famous soon enough
Careful with your mass balances.

A term in the material/multicomponent equation is to be treated carefully, it should not add mass to the system, but drive the transport of the material.

Adding mass to the system it should only be done using continuity sources. A continuity source must be specified in detail, i.e you must include its composition.

If you attempt to do it by adding sources to the material components you must be extremely careful to conserve global mass. Recall the summation of all the material component equations should be the same as the global continuity equation. That is the reason there is a constrain material component; otherwise, the system will over specified.
lordluan likes this.
Opaque is offline   Reply With Quote

Old   December 3, 2019, 09:57
Default
  #3
New Member
 
Lucas
Join Date: May 2019
Posts: 29
Rep Power: 2
lordluan is on a distinguished road
Quote:
Originally Posted by Opaque View Post
Careful with your mass balances.

A term in the material/multicomponent equation is to be treated carefully, it should not add mass to the system, but drive the transport of the material.

Adding mass to the system it should only be done using continuity sources. A continuity source must be specified in detail, i.e you must include its composition.

If you attempt to do it by adding sources to the material components you must be extremely careful to conserve global mass. Recall the summation of all the material component equations should be the same as the global continuity equation. That is the reason there is a constrain material component; otherwise, the system will over specified.
Thanks for answering, Opaque. I understand what you're saying. Please have a look at the pic bellow.

It is a print from CFX, the continuity that is chosen is the correspondent to the ethanol ou the global one? In the fluid models settings I put ethanol to have a transport equation and air to be constraint.

I am reading the documentation and doing some tests to find out. Any news I will share here.
Attached Images
File Type: png sourceterm.PNG (21.7 KB, 7 views)
lordluan is offline   Reply With Quote

Old   December 3, 2019, 11:49
Default
  #4
Senior Member
 
Join Date: Jun 2009
Posts: 1,065
Rep Power: 22
Opaque will become famous soon enough
If Sm (mass source strength)
- is positive only ethanol is being added
- and, if negative only ethanol is being removed (here the sink options kicks in for the specific behavior)

The corresponding source terms are included in all solved transport equations.

It should work for you.
lordluan likes this.
Opaque is offline   Reply With Quote

Old   December 5, 2019, 01:35
Default
  #5
Senior Member
 
Join Date: Feb 2011
Posts: 491
Rep Power: 13
Antanas is on a distinguished road
Quote:
Originally Posted by lordluan View Post
Thanks for answering, Opaque. I understand what you're saying. Please have a look at the pic bellow.

It is a print from CFX, the continuity that is chosen is the correspondent to the ethanol ou the global one? In the fluid models settings I put ethanol to have a transport equation and air to be constraint.

I am reading the documentation and doing some tests to find out. Any news I will share here.
Sources are added per phase. Specified component mass fraction controls which part of the source corresponds to it. Because you set ethanol mf to 1, the source adds (or substracts) only ethanol.
lordluan likes this.
Antanas is offline   Reply With Quote

Old   December 7, 2019, 05:53
Default
  #6
New Member
 
Lucas
Join Date: May 2019
Posts: 29
Rep Power: 2
lordluan is on a distinguished road
Thanks for the reply, but, apparently, it didn't work. Since the mass fraction increased, instead of decrease. Antanas and Opaque, is there another way of making CFX understand that the source term is only to ethanol?
lordluan is offline   Reply With Quote

Old   December 8, 2019, 18:54
Default
  #7
Senior Member
 
Join Date: Jun 2009
Posts: 1,065
Rep Power: 22
Opaque will become famous soon enough
Could you post the settings for your source?
Opaque is offline   Reply With Quote

Old   Yesterday, 10:25
Default
  #8
New Member
 
Lucas
Join Date: May 2019
Posts: 29
Rep Power: 2
lordluan is on a distinguished road
Quote:
Originally Posted by Opaque View Post
Could you post the settings for your source?
Sure, Opaque. I am attaching a photo and the whole code.

LIBRARY:
CEL:
EXPRESSIONS:
A = 132.89 [s^-1]
E = 139.5 [kJ mol^-1]
Ea = 22.97 [kJ mol^-1]
Ps = 0.1041 [Pa]
R0 = 0.0083145 [kJ mol^-1 K^-1]
Sm = -(1-volpor)*roP*k1*(qe-q)
fm = 1-fluid.air.mf
k1 = A*e^(-(Ea/(R0*T)))
q = qe*(1-e^(-k1*t))
qe = qs*exp(-(((R0*(T/E))*ln(Ps/(ptot))))^2)
qs = 1.2 [kg kg^-1]
roP = 464.1 [kg m^-3]
END
END
MATERIAL: ADSOR
Material Group = User
Option = Pure Substance
Thermodynamic State = Solid
PROPERTIES:
Option = General Material
EQUATION OF STATE:
Density = 464.1 [kg m^-3]
Molar Mass = 12 [g mol^-1]
Option = Value
END
SPECIFIC HEAT CAPACITY:
Option = Value
Specific Heat Capacity = 1375 [J kg^-1 K^-1]
END
REFERENCE STATE:
Option = Automatic
END
THERMAL CONDUCTIVITY:
Option = Value
Thermal Conductivity = 0.2 [W m^-1 K^-1]
END
END
END
MATERIAL: Air Ideal Gas
Material Description = Air Ideal Gas (constant Cp)
Material Group = Air Data,Calorically Perfect Ideal Gases
Option = Pure Substance
Thermodynamic State = Gas
PROPERTIES:
Option = General Material
EQUATION OF STATE:
Molar Mass = 28.96 [kg kmol^-1]
Option = Ideal Gas
END
SPECIFIC HEAT CAPACITY:
Option = Value
Specific Heat Capacity = 1.0044E+03 [J kg^-1 K^-1]
Specific Heat Type = Constant Pressure
END
REFERENCE STATE:
Option = Specified Point
Reference Pressure = 1 [atm]
Reference Specific Enthalpy = 0. [J/kg]
Reference Specific Entropy = 0. [J/kg/K]
Reference Temperature = 25 [C]
END
DYNAMIC VISCOSITY:
Dynamic Viscosity = 1.831E-05 [kg m^-1 s^-1]
Option = Value
END
THERMAL CONDUCTIVITY:
Option = Value
Thermal Conductivity = 2.61E-2 [W m^-1 K^-1]
END
ABSORPTION COEFFICIENT:
Absorption Coefficient = 0.01 [m^-1]
Option = Value
END
SCATTERING COEFFICIENT:
Option = Value
Scattering Coefficient = 0.0 [m^-1]
END
REFRACTIVE INDEX:
Option = Value
Refractive Index = 1.0 [m m^-1]
END
END
END
MATERIAL: Mix
Material Group = User
Materials List = air,ethanol
Option = Variable Composition Mixture
Thermodynamic State = Gas
MIXTURE PROPERTIES:
Option = Ideal Mixture
EQUATION OF STATE:
Option = Ideal Mixture
END
SPECIFIC HEAT CAPACITY:
Option = Ideal Mixture
END
END
END
MATERIAL: N2
Material Group = User
Option = Pure Substance
Thermodynamic State = Gas
PROPERTIES:
Option = General Material
EQUATION OF STATE:
Density = 0.8556 [kg m^-3]
Molar Mass = 28.0134 [g mol^-1]
Option = Value
END
SPECIFIC HEAT CAPACITY:
Option = Value
Specific Heat Capacity = 29.271 [cal g^-1 K^-1]
Specific Heat Type = Constant Pressure
END
REFERENCE STATE:
Option = Specified Point
Reference Pressure = 1 [atm]
Reference Temperature = 399 [K]
END
END
END
MATERIAL: air
Material Group = User
Option = Pure Substance
Thermodynamic State = Gas
PROPERTIES:
Option = General Material
EQUATION OF STATE:
Density = 1.185 [kg m^-3]
Molar Mass = 28.96 [kg kmol^-1]
Option = Value
END
SPECIFIC HEAT CAPACITY:
Option = Value
Specific Heat Capacity = 1.0044E+03 [J kg^-1 K^-1]
Specific Heat Type = Constant Pressure
END
REFERENCE STATE:
Option = Specified Point
Reference Pressure = 1 [atm]
Reference Specific Enthalpy = 0 [J kg^-1]
Reference Specific Entropy = 0 [J kg^-1 K^-1]
Reference Temperature = 25 [C]
END
DYNAMIC VISCOSITY:
Dynamic Viscosity = 20.86e-6 [Pa s]
Option = Value
END
THERMAL EXPANSIVITY:
Option = Value
Thermal Expansivity = 0.003356 [K^-1]
END
END
END
MATERIAL: ethanol
Material Group = User
Option = Pure Substance
Thermodynamic State = Gas
PROPERTIES:
Option = General Material
EQUATION OF STATE:
Density = 736.1 [kg m^-3]
Molar Mass = 46.0684 [g mol^-1]
Option = Value
END
SPECIFIC HEAT CAPACITY:
Option = Value
Specific Heat Capacity = 3.19 [J kg^-1 K^-1]
Specific Heat Type = Constant Pressure
END
REFERENCE STATE:
Option = Specified Point
Reference Pressure = 1 [atm]
Reference Temperature = 25 [C]
END
DYNAMIC VISCOSITY:
Dynamic Viscosity = 10.4e-6 [Pa s]
Option = Value
END
END
END
MATERIAL: iPentano
Material Group = User
Option = Pure Substance
Thermodynamic State = Gas
PROPERTIES:
Option = General Material
EQUATION OF STATE:
Density = 2.2337 [kg m^-3]
Molar Mass = 72.15 [g mol^-1]
Option = Value
END
SPECIFIC HEAT CAPACITY:
Option = Value
Specific Heat Capacity = 154.15 [J kg^-1 K^-1]
Specific Heat Type = Constant Pressure
END
REFERENCE STATE:
Option = Specified Point
Reference Pressure = 1 [atm]
Reference Temperature = 400 [K]
END
END
END
MATERIAL: nPentano
Material Group = User
Option = Pure Substance
Thermodynamic State = Gas
PROPERTIES:
Option = General Material
EQUATION OF STATE:
Density = 2.2345 [kg m^-3]
Molar Mass = 72.17 [g mol^-1]
Option = Value
END
SPECIFIC HEAT CAPACITY:
Option = Value
Specific Heat Capacity = 2.13 [J kg^-1 K^-1]
Specific Heat Type = Constant Pressure
END
REFERENCE STATE:
Option = Specified Point
Reference Pressure = 1 [atm]
Reference Temperature = 400 [K]
END
END
END
END
FLOW: Flow Analysis 1
SOLUTION UNITS:
Angle Units = [rad]
Length Units = [m]
Mass Units = [kg]
Solid Angle Units = [sr]
Temperature Units = [K]
Time Units = [s]
END
ANALYSIS TYPE:
Option = Transient
EXTERNAL SOLVER COUPLING:
Option = None
END
INITIAL TIME:
Option = Automatic with Value
Time = 0 [min]
END
TIME DURATION:
Option = Total Time
Total Time = 20 [min]
END
TIME STEPS:
Option = Timesteps
Timesteps = 1 [min]
END
END
DOMAIN: Default Domain
Coord Frame = Coord 0
Domain Type = Porous
Location = ADSORVENT
BOUNDARY: In
Boundary Type = INLET
Location = IN
BOUNDARY CONDITIONS:
COMPONENT: ethanol
Mass Fraction = 0.4
Option = Mass Fraction
END
FLOW REGIME:
Option = Subsonic
END
MASS AND MOMENTUM:
Normal Speed = 0.03 [m s^-1]
Option = Normal Speed
END
TURBULENCE:
Option = Medium Intensity and Eddy Viscosity Ratio
END
END
END
BOUNDARY: Out
Boundary Type = OPENING
Location = OUT
BOUNDARY CONDITIONS:
COMPONENT: ethanol
Mass Fraction = fm
Option = Mass Fraction
END
FLOW DIRECTION:
Option = Normal to Boundary Condition
END
FLOW REGIME:
Option = Subsonic
END
MASS AND MOMENTUM:
Option = Opening Pressure and Direction
Relative Pressure = 1 [atm]
END
TURBULENCE:
Option = Medium Intensity and Eddy Viscosity Ratio
END
END
END
BOUNDARY: Wall
Boundary Type = WALL
Location = WALL
BOUNDARY CONDITIONS:
MASS AND MOMENTUM:
Option = No Slip Wall
END
WALL ROUGHNESS:
Option = Smooth Wall
END
END
END
DOMAIN MODELS:
BUOYANCY MODEL:
Option = Non Buoyant
END
DOMAIN MOTION:
Option = Stationary
END
MESH DEFORMATION:
Option = None
END
REFERENCE PRESSURE:
Reference Pressure = 1 [atm]
END
END
FLUID DEFINITION: fluid
Material = Mix
Option = Material Library
MORPHOLOGY:
Option = Continuous Fluid
END
END
FLUID MODELS:
COMBUSTION MODEL:
Option = None
END
COMPONENT: air
Option = Constraint
END
COMPONENT: ethanol
Option = Transport Equation
END
HEAT TRANSFER MODEL:
Fluid Temperature = 352 [K]
Option = Isothermal
END
THERMAL RADIATION MODEL:
Option = None
END
TURBULENCE MODEL:
Option = k epsilon
END
TURBULENT WALL FUNCTIONS:
Option = Scalable
END
END
POROSITY MODELS:
AREA POROSITY:
Option = Isotropic
END
LOSS MODEL:
Loss Velocity Type = Superficial
Option = Isotropic Loss
ISOTROPIC LOSS MODEL:
Option = Permeability and Loss Coefficient
Permeability = 8.379e-12 [m^2]
Resistance Loss Coefficient = 3.447e5 [m^-1]
END
END
VOLUME POROSITY:
Option = Value
Volume Porosity = 0.4075
END
END
SOLID DEFINITION: adsor
Material = ADSOR
Option = Material Library
MORPHOLOGY:
Option = Continuous Solid
END
END
SOLID MODELS:
HEAT TRANSFER MODEL:
Option = Isothermal
Solid Temperature = 352 [K]
END
THERMAL RADIATION MODEL:
Option = None
END
END
SUBDOMAIN: TermoFonte
Coord Frame = Coord 0
Location = ADSORVENT
SOURCES:
EQUATION SOURCE: continuity
Multiply by Porosity = Off
Option = Fluid Mass Source
Sink Option = Local Mass Fractions and Temperature
Source = Sm
VARIABLE: ed
Option = Value
Value = 1 [m^2 s^-3]
END
VARIABLE: ethanol.mf
Option = Value
Value = 1 []
END
VARIABLE: ke
Option = Value
Value = 1 [m^2 s^-2]
END
VARIABLE: vel
Option = Cartesian Vector Components
xValue = 1 [m s^-1]
yValue = 1 [m s^-1]
zValue = 1 [m s^-1]
END
END
END
END
END
INITIALISATION:
Option = Automatic
INITIAL CONDITIONS:
Velocity Type = Cartesian
CARTESIAN VELOCITY COMPONENTS:
Option = Automatic with Value
U = 0 [m s^-1]
V = 2.52e-3 [m s^-1]
W = 0 [m s^-1]
END
COMPONENT: ethanol
Mass Fraction = 0.3
Option = Automatic with Value
END
STATIC PRESSURE:
Option = Automatic with Value
Relative Pressure = 0 [Pa]
END
TURBULENCE INITIAL CONDITIONS:
Option = Medium Intensity and Eddy Viscosity Ratio
END
END
END
OUTPUT CONTROL:
RESULTS:
File Compression Level = Default
Include Mesh = No
Option = Selected Variables
Output Variables List = Absolute Pressure,Pressure,ethanol.Molar \
Concentration,ethanol.Mass Fraction,ethanol.Mass Concentration
END
TRANSIENT RESULTS: Transient Results 1
File Compression Level = Default
Include Mesh = On
Option = Selected Variables
Output Boundary Flows = All
Output Equation Residuals = All
Output Variable Operators = All
Output Variables List = ethanol.Molar Concentration,ethanol.Mass \
Fraction,ethanol.Mass Concentration,ethanol.Molar Fraction
OUTPUT FREQUENCY:
Option = Every Timestep
END
END
END
SOLVER CONTROL:
Turbulence Numerics = First Order
ADVECTION SCHEME:
Option = High Resolution
END
CONVERGENCE CONTROL:
Maximum Number of Coefficient Loops = 10
Minimum Number of Coefficient Loops = 1
Timescale Control = Coefficient Loops
END
CONVERGENCE CRITERIA:
Residual Target = 1.E-4
Residual Type = RMS
END
TRANSIENT SCHEME:
Option = Second Order Backward Euler
TIMESTEP INITIALISATION:
Option = Automatic
END
END
END
END
COMMAND FILE:
Version = 18.2
Results Version = 18.2
END
SIMULATION CONTROL:
EXECUTION CONTROL:
EXECUTABLE SELECTION:
Double Precision = No
Large Problem = No
END
INTERPOLATOR STEP CONTROL:
Runtime Priority = Standard
MEMORY CONTROL:
Memory Allocation Factor = 1.0
END
END
PARALLEL HOST LIBRARY:
HOST DEFINITION: lordluan
Host Architecture String = winnt-amd64
Installation Root = C:\Program Files\ANSYS Inc\v%v\CFX
END
END
PARTITIONER STEP CONTROL:
Multidomain Option = Automatic
Runtime Priority = Standard
MEMORY CONTROL:
Memory Allocation Factor = 1.0
END
PARTITION SMOOTHING:
Maximum Partition Smoothing Sweeps = 100
Option = Smooth
END
PARTITIONING TYPE:
MeTiS Type = k-way
Option = MeTiS
Partition Size Rule = Automatic
END
END
RUN DEFINITION:
Run Mode = Full
Solver Input File = C:\Users\Lordluan \luan
\Downloads\TCC\Teste2\9_v5_transient.def
Solver Results File = C:\Users\Lordluan \
luan\Downloads\TCC\Teste2\9_v5_transient_004.res
END
SOLVER STEP CONTROL:
Runtime Priority = Standard
MEMORY CONTROL:
Memory Allocation Factor = 1.0
END
PARALLEL ENVIRONMENT:
Number of Processes = 1
Start Method = Serial
END
END
END
END
Attached Images
File Type: png sourceterm.PNG (21.7 KB, 1 views)
lordluan is offline   Reply With Quote

Old   Yesterday, 10:43
Default
  #9
Senior Member
 
Join Date: Jun 2009
Posts: 1,065
Rep Power: 22
Opaque will become famous soon enough
Based on your settings, the total amount of mass removed (assuming Sm < 0) would be something along

volumeInt(Sm * Ethanol.mf)@TermoFonte


Your source specification is based on Local Mass Fractions, that is, it will remove whatever is "available" of Ethanol in the subdomain.

If you look at the output file summary (end of the run), how much is the mass flow for the subdomain? Look at the P-Mass summary as well as the Ethanol.Mass Fraction summary
Opaque is offline   Reply With Quote

Old   Yesterday, 21:35
Default
  #10
New Member
 
Lucas
Join Date: May 2019
Posts: 29
Rep Power: 2
lordluan is on a distinguished road
Quote:
Originally Posted by Opaque View Post
Based on your settings, the total amount of mass removed (assuming Sm < 0) would be something along

volumeInt(Sm * Ethanol.mf)@TermoFonte


Your source specification is based on Local Mass Fractions, that is, it will remove whatever is "available" of Ethanol in the subdomain.

If you look at the output file summary (end of the run), how much is the mass flow for the subdomain? Look at the P-Mass summary as well as the Ethanol.Mass Fraction summary
Opaque, I am facing convergence problems, soon, I will be capable of answering your questions. Thank you very much for the help.
lordluan is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Direct numerical simulation of species transport equation with phase change Pmaroul Main CFD Forum 2 October 12, 2018 17:02
p_rgh initial residual no change with different settings manuc OpenFOAM Running, Solving & CFD 3 June 26, 2018 16:53
continuity equation rhoEqn.H Fridrik OpenFOAM Programming & Development 3 November 15, 2017 00:16
AMI interDyMFoam for mixer nu problem danny123 OpenFOAM Programming & Development 8 September 6, 2013 03:34
Poisson equation vs continuity equation DJ Main CFD Forum 1 August 5, 2004 21:01


All times are GMT -4. The time now is 18:51.