|
[Sponsors] |
Adding a mass source term to compressibleInterFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 5, 2021, 08:16 |
Adding a mass source term to compressibleInterFoam
|
#1 |
Member
Join Date: Mar 2021
Posts: 39
Rep Power: 5 |
Hello to all,
I would like to know how to add a mass source term to compressibleInterFoam and a clarification on fvOptions code syntax. In my simulation phase1 is water and phase2 is air. Since we are using the mass conservation equation to write the pressure correction equation, the mass source should be placed there (is this correct?). In pEqn.H file we have from line 26 to 95 Code:
tmp<fvScalarMatrix> p_rghEqnComp1; tmp<fvScalarMatrix> p_rghEqnComp2; if (pimple.transonic()) { #include "rhofs.H" surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi); surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi); p_rghEqnComp1 = pos(alpha1) *( ( fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f) - (fvOptions(alpha1, mixture.thermo1().rho())&rho1) )/rho1 - fvc::ddt(alpha1) - fvc::div(alphaPhi1) + (alpha1/rho1) *correction ( psi1*fvm::ddt(p_rgh) + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) ) ); p_rghEqnComp1.ref().relax(); p_rghEqnComp2 = pos(alpha2) *( ( fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f) - (fvOptions(alpha2, mixture.thermo2().rho())&rho2) )/rho2 - fvc::ddt(alpha2) - fvc::div(alphaPhi2) + (alpha2/rho2) *correction ( psi2*fvm::ddt(p_rgh) + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) ) ); p_rghEqnComp2.ref().relax(); } else { #include "rhofs.H" p_rghEqnComp1 = pos(alpha1) *( ( fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f) - (fvOptions(alpha1, mixture.thermo1().rho())&rho1) )/rho1 - fvc::ddt(alpha1) - fvc::div(alphaPhi1) + (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh)) ); p_rghEqnComp2 = pos(alpha2) *( ( fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f) - (fvOptions(alpha2, mixture.thermo2().rho())&rho2) )/rho2 - fvc::ddt(alpha2) - fvc::div(alphaPhi2) + (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh)) ); } I would like to know the following: How can I put a source term there? In my fvOptions dictionary I have: Code:
massSource { type scalarCodedSource; selectionMode all; fields (?thermo:rho.water?); // Name of the coded source name sourceTime; Additionally, can anyone clarify the entries on the fvOptions code syntax, e.g., Code:
fvOptions(alpha1, mixture.thermo1().rho())&rho1) Code:
fvOptions(rho, U) Last edited by trailer; May 6, 2021 at 04:24. |
|
January 7, 2023, 22:26 |
|
#2 |
New Member
Corbin G
Join Date: Oct 2022
Location: Midwest, USA
Posts: 11
Rep Power: 3 |
Hi trailer,
Did you ever figure out how to add the mass source term to the compressibleInterFoam solver? I am trying to do a similar thing but I am struggling to figure out the formulation of the p_rghEqnComp1 and p_rghEqnComp2 in pEqn.H. Best regards, Corbin |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 03:50 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 01:22 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 13:59 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 10:57 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 01:24 |