# programming with external term and equation

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 8, 2015, 09:18 programming with external term and equation #1 New Member   Join Date: Sep 2014 Posts: 9 Rep Power: 3 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: 323 Rep Power: 10 first equation Code: ```fvm::ddt(U) + fvm::div(phi,U) - fvm::laplacian(nu,U) + fvm::SuSp(chi, U) - fvc::Sp(chi, Ubar) == -grad(p)``` second equation Code: ```fvm::ddt(Ubar) + fvm::SuSp(omega,Ubar) - fvc::Sp(omega,U)```

 October 8, 2015, 12:38 #3 New Member   Join Date: Sep 2014 Posts: 9 Rep Power: 3 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: 323 Rep Power: 10 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 New Member   Join Date: Sep 2014 Posts: 9 Rep Power: 3 Hi Matvej, this time I understand, thank you very much regards yong

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Mihail CFX 7 September 7, 2014 06:27 styleworker OpenFOAM Programming & Development 2 September 3, 2014 21:24 hans-186 Main CFD Forum 4 April 1, 2013 13:34 be_inspired OpenFOAM Programming & Development 1 March 19, 2013 11:50 Joseph CFX 14 April 20, 2010 15:45

All times are GMT -4. The time now is 19:09.

 Contact Us - CFD Online - Top