|
[Sponsors] |
Different ways to treat source terms of an additional transport equation in OpenFOAM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 23, 2021, 19:48 |
Different ways to treat source terms of an additional transport equation in OpenFOAM
|
#1 |
New Member
Join Date: Jan 2015
Posts: 22
Rep Power: 11 |
I have created a modified solver based on simpleFoam and called it twosimpleFoam. I added one scalar tranport equation to track number density of particles () in a laminar flow.
Below is the transport equation I am trying to solve. I have created "NEqn.H" file similar and included it in twosimpleFoam.C. I have two versions of "NEqn.H". The only difference how I solve the source source term. The first one ends up with "core dump", but second one converges. I don't understand which one is the correct way to solve this equation and how these two implementations are different. First Implementation (DIVERGES!): Code:
{ fvScalarMatrix NEqn ( fvm::ddt(N_agg) + fvm::div(phi, N_agg) - fvm::laplacian(diff_prefactor*diff_p, N_agg) == -fvm::Sp(0.5 * beta * N_agg * Av * rho, N_agg)) ); NEqn.relax(); fvOptions.constrain(NEqn); NEqn.solve(); fvOptions.correct(N_agg); } Code:
{ fvScalarMatrix NEqn ( fvm::ddt(N_agg) + fvm::div(phi, N_agg) - fvm::laplacian(diff_prefactor*diff_p, N_agg) == fvOptions(N_agg) ); NEqn.relax(); fvOptions.constrain(NEqn); solve(NEqn == -fvm::Sp(0.5 * beta * N_agg * Av * rho, N_agg)); fvOptions.correct(N_agg); } |
|
Tags |
scalar transport, source term |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 18:13 |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 06:42 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 12:41 |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 05:18 |
emag beta feature: charge density | charlotte | CFX | 4 | March 22, 2011 09:14 |