|
[Sponsors] |
October 8, 2015, 09:18 |
programming with external term and equation
|
#1 |
Member
Join Date: Sep 2014
Posts: 32
Rep Power: 12 |
Hello everyone, I am quite new to OpenFoam, especially to the programming part. Now I would like to solve the following equation:
ddt(U)+div(phi,U)-laplacian(nu,U) == -grad(p) - chi * (U-Ubar) ddt(Ubar) == omega * (U - Ubar) in which Ubar is another field vector. For the last red terms in both equation, they are direct multiplication of scalar and vector field. How should I discrete it? Like for other terms: fvm::div(phi,U), what is the operator for such a direct calculation? Many thanks Yong |
|
October 8, 2015, 10:04 |
|
#2 |
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21 |
first equation
Code:
fvm::ddt(U) + fvm::div(phi,U) - fvm::laplacian(nu,U) + fvm::SuSp(chi, U) - fvc::Sp(chi, Ubar) == -grad(p) Code:
fvm::ddt(Ubar) + fvm::SuSp(omega,Ubar) - fvc::Sp(omega,U) |
|
October 8, 2015, 12:38 |
|
#3 |
Member
Join Date: Sep 2014
Posts: 32
Rep Power: 12 |
Hi Matvej, thanks for the quick reply. I've tried your suggestion and find that the following term can not pass compilation.
fvm::SuSp(chi, U) with the error: error: no matching function for call to ‘SuSp(Foam::dimensionedScalar&, Foam::volVectorField&)’ + fvm::SuSp(chi, U) it seems the match problem of dimensionedScalar and volVectorField. But if I use fvm::Sp(chi, U) the compilation passed. Would you mind to explained a bit for me the difference of Sp and SuSp. Regards Yong |
|
October 8, 2015, 12:44 |
|
#4 |
Senior Member
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21 |
fvm::Sp - implicit source term
fvc::Sp - explicit source term fvm::SuSp(chi,U) - dynamically switched term, for cells where chi >= 0 it is treated as implicit , where chi < 0 it is treated as explicit to preserve diagonal elements untouched if you want to use fvm::SuSp, then variable chi must be of type volScalarField |
|
October 8, 2015, 13:01 |
|
#5 |
Member
Join Date: Sep 2014
Posts: 32
Rep Power: 12 |
Hi Matvej,
this time I understand, thank you very much regards yong |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Source Term due to evaporation in energy transport equation | styleworker | OpenFOAM Programming & Development | 3 | September 7, 2022 03:09 |
Calculation of the Governing Equations | Mihail | CFX | 7 | September 7, 2014 06:27 |
viscosity term in discetrization momentum equation | hans-186 | Main CFD Forum | 4 | April 1, 2013 13:34 |
How to? Extra term in k-e equation. Implicit-Explicit | be_inspired | OpenFOAM Programming & Development | 1 | March 19, 2013 10:50 |
ATTENTION! Reliability problems in CFX 5.7 | Joseph | CFX | 14 | April 20, 2010 15:45 |