|
[Sponsors] |
February 27, 2017, 11:52 |
Implementing variable Diffusion Coefficient
|
#1 |
New Member
Peter im Hof
Join Date: Nov 2013
Posts: 9
Rep Power: 12 |
Dear foamers,
I am trying to expand the functionality of twoLiquidMixingFoam so that it can handle Diffusion coefficients which depend on the volume fraction of one of the liquids: in which and are positive constants. Given this dependency and assuming (neglecting advection) the advection-diffusion-equation looks as follows: The first term is already implemented in twoLiquidMixingFoam/alphaDiffusionEqn.H, whereas the second one is missing: Code:
fvScalarMatrix alpha1Eqn ( fvm::ddt(alpha1) - fvc::ddt(alpha1) - fvm::laplacian ( volScalarField("Dab", Dab + alphatab*turbulence->nut()), alpha1 ) ); The first try was taking the values from the last timestep: Code:
Dab = C1*Foam::exp(C2*alpha1); volScalarField Sc = fvc::grad(Dab) & fvc::grad(alpha1); fvScalarMatrix alpha1Eqn ( fvm::ddt(alpha1) - fvc::ddt(alpha1) - fvm::laplacian ( volScalarField("Dab", Dab + alphatab*turbulence->nut()), alpha1 ) == Sc ); Code:
Starting time loop ... Courant Number mean: 0 max: 0 Interface Courant Number mean: 0 max: 0 Z number max: 0 deltaT = 0.0119976 Time = 0.0119976 MULES: Solving for alpha1 Phase-1 volume fraction = 0.027 Min(alpha1) = 0 Max(alpha1) = 1 ... ExecutionTime = 0.54 s ClockTime = 0 s Courant Number mean: 0 max: 0 Interface Courant Number mean: 0 max: 0 Z number max: 3382.27 deltaT = 7.0944e-06 Time = 0.0120047 MULES: Solving for alpha1 Phase-1 volume fraction = 0.0681488 Min(alpha1) = 0 Max(alpha1) = 15.1184 MULES: Solving for alpha1 ... The second way I tried to implement the additional term was by using Picard's method (https://www.cfd-online.com/Wiki/Sour...inearization): Code:
Dab = C1*Foam::exp(C2*alpha1); volScalarField Sp = C1*C2*C2*Foam::exp(C2*alpha1) * fvc::grad(alpha1) & fvc::grad(alpha1); volScalarField Sc = (C1*C2*Foam::exp(C2*alpha1) * fvc::grad(alpha1) & fvc::grad(alpha1))*(1-C2*alpha1); fvScalarMatrix alpha1Eqn ( fvm::ddt(alpha1) - fvc::ddt(alpha1) - fvm::laplacian ( volScalarField("Dab", Dab + alphatab*turbulence->nut()), alpha1 ) == fvm::Sp(Sp, alpha1) + Sc ); Does anyone have an Idea how to improve the implementation? I would be very grateful if anyone could give me a hint how to solve the problem. Last edited by saimat; February 28, 2017 at 09:02. Reason: use of [math][/math] |
|
March 11, 2017, 03:58 |
|
#2 |
New Member
Peter im Hof
Join Date: Nov 2013
Posts: 9
Rep Power: 12 |
I figured out, that the implementation in OpenFoam is already suitable for variable coefficients (see Programmers Guide table 2.2 / Chapter 2.4.1). I was just misrouted by the name "laplacian(D,alpha)". Consequently adding an additional term is not necessary.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
diffusion Term for add. Variable | Zaktatir | CFX | 9 | July 16, 2011 09:51 |
how to detemine thermal diffusion coefficient in multi-component flow?? | oilsok | FLUENT | 1 | April 23, 2011 14:12 |
variable diffusion coefficient | alinematollahi | CFX | 15 | November 16, 2010 07:47 |
diffusion coefficient in scalar equaton | mike | Siemens | 0 | August 30, 2006 11:42 |