|
[Sponsors] |
Adding complex source term in momentum equation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 24, 2019, 22:48 |
Adding complex source term in momentum equation
|
#1 |
Member
Bidesh Sengupta
Join Date: Sep 2018
Location: Sngapore
Posts: 76
Rep Power: 8 |
Hi Foamers,
I wish to add some complex source term in the momentum equation, which is giving me a bit of trouble. If any one can help me, it shall be great. I have attached the images of the equations that are used. I have written the following code. volScalarField ux = U.component(vector::X); volScalarField uy = U.component(vector::Y); volScalarField uz = U.component(vector::Z); volScalarField u_airx = U_Air.component(vector::X); volScalarField u_airy = U_Air.component(vector::Y); volScalarField u_airz = U_Air.component(vector::Z); volScalarField Re_u = (rho_Air*MVD/mu_Air)*mag(u_airx-ux); volScalarField Re_v = (rho_Air*MVD/mu_Air)*mag(u_airy-uy); volScalarField Re_w = (rho_Air*MVD/mu_Air)*mag(u_airz-uz); volScalarField CD_u = (24/Re_u)*(1+0.0197*pow(Re_u,0.63)+2.6e-4*pow(Re_u,1.38)); volScalarField CD_v = (24/Re_v)*(1+0.0197*pow(Re_v,0.63)+2.6e-4*pow(Re_v,1.38)); volScalarField CD_w = (24/Re_w)*(1+0.0197*pow(Re_w,0.63)+2.6e-4*pow(Re_w,1.38)); volScalarField A_u = 0.75*rho_Air*CD_u*Re_u*mu_Air/(rho*pow(MVD,2)); volScalarField A_v = 0.75*rho_Air*CD_v*Re_v*mu_Air/(rho*pow(MVD,2)); volScalarField A_w = 0.75*rho_Air*CD_w*Re_w*mu_Air/(rho*pow(MVD,2)); volScalarField SD_x = A_u*(u_airx-ux); volScalarField SD_y = A_v*(u_airy-uy); volScalarField SD_z = A_w*(u_airz-uz); volVectorField SD = SD_x*vector(1,0,0)+SD_y*vector(0,1,0)+SD_z*vector( 0,0,1); volScalarField frac = (1-rho_Air/rho)*g_z; volVectorField SG = -frac*rho*vector(0,0,1); !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! solve ( 1.0/beta[i]*fvm::ddt(rhoU) + fvc::div(dbnsFlux.rhoUFlux()) + fvc::Sp(1, SD) + fvc::Sp(1, SG) ); The compilation was successful but when I am trying to run the simulation it shows segmentation fault, core dumped. To test I ran the simulation putting off the 'SD' term, the simulation went well. I think I am making mistake in evaluating 'SD' term. Kindly help me to overcome it. Thank you very much for your time. |
|
September 5, 2019, 05:34 |
|
#2 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Division by zero because MVD goes to zero?
__________________
www.cypriensoulaine.com/openfoam |
|
September 8, 2019, 02:57 |
|
#3 |
Member
Bidesh Sengupta
Join Date: Sep 2018
Location: Sngapore
Posts: 76
Rep Power: 8 |
Yes, Thank you.
You are right. I corrected it and it runs. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding of source term in momentum equation required any changes in PISO algorith | shadabdyn | OpenFOAM Programming & Development | 2 | January 15, 2017 02:16 |
[swak4Foam] swak4foam building problem | GGerber | OpenFOAM Community Contributions | 54 | April 24, 2015 17:02 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 13:41 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |