|
[Sponsors] |
Implementation of Implicit Source term in OpenFOAM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 14, 2014, 23:28 |
Implementation of Implicit Source term in OpenFOAM
|
#1 |
New Member
Delstat
Join Date: Apr 2013
Posts: 15
Rep Power: 13 |
Dear All,
I am currently trying to solve linear and non-linear Poisson equation with implicit source terms in OpenFoam. I would like to request your feedback. Case I : linear Poisson equation Solve for : del^2(T) - T = 0 Source : S = -T Implicit source: S = Su + Sp*T Su = 0, Sp = -1 Open Foam: fvm::laplacian(T) == -fvm::Sp(Sp,T) + Su I defined Sp and Su as "VolScalarField". I was successfully able to solve the case and compared it with the analytically results. ************************************************** *********** Case II: Non-linear Poisson equation Solve for : del^2(T) - T^2 = 0 Source : S = -T^2 Implicit source: S = Su + Sp*T With taylor's series expansion: S = To^2 + (- 2To)*T Su = To^2, Sp = (- 2To) I am facing errors to implement these sources terms. How to mimic these equation in OpenFoam syntax? How to define Su and Sp in terms of To.? Please find the attached Snapshot for your reference. Would be great to hear your feedback on Case II. Thank you very much and have a wonderful day. Cheers, Pradeep |
|
August 18, 2014, 00:28 |
|
#2 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Hi,
It would have been easier if you post the error message. The implementation is similar to your first case. I guess you should program Foam:ow(T0,2) for T0^2. Maybe your compilation error comes from here. Another point you have to be careful is the dimension of T ! Indeed, despite the case where T is dimensionless, your equation is not correct (at least you should put an dimensionedScalar factor in front of your source term in order to be homogeneous). Best, Cyp |
|
August 18, 2014, 01:07 |
|
#3 |
New Member
Delstat
Join Date: Apr 2013
Posts: 15
Rep Power: 13 |
Dear Cpy,
Thank you very much for your feedback and i highly appreciate that. Could you please elaborate on the dimensionedScalar factor? Case I: ----> fvm::laplacian(T)== -fvm::Sp(Sp,T) + Su dimensionedScalar factor for source terms, you mean for Sp and Su??? Case II: ----> fvm::laplacian(T)== T*T*A Where: A is a dummy object to make the operation compatible. Thank you very much Cheers, Pradeep |
|
August 18, 2014, 01:10 |
|
#4 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
For both cases, I will declare A as :
Code:
dimensionedScalar A ("A", dimless/T.dimensions()/dimLength/dimLength, 1.0); Code:
fvm::laplacian(T) == -fvm::Sp(2*T0*A,T) + Foam::pow(T0,2)*A Cyp |
|
August 18, 2014, 01:30 |
|
#5 |
New Member
Delstat
Join Date: Apr 2013
Posts: 15
Rep Power: 13 |
Dear Cpy,
I have updated the new syntax and with the new dimension syntax,I am facing the incompatibility error for operation. Please find the attached snapshot for your reference. Thank you very much. Cheers, Pradeep |
|
August 18, 2014, 01:40 |
|
#6 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Indeed it is obvious (because of the laplacian..). I modified my previous post.
|
|
August 18, 2014, 01:57 |
|
#7 |
New Member
Delstat
Join Date: Apr 2013
Posts: 15
Rep Power: 13 |
It worked! Thank you very much Cpy
|
|
May 20, 2016, 07:30 |
|
#8 |
Senior Member
Alejandro
Join Date: Jan 2014
Location: Argentina
Posts: 128
Rep Power: 12 |
Could you please explain how to modify code to solve a general nonlinear Poisson equation?
Step by Step if is it possible, because I do not fully understand |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 03:30 |
Anisotropic, implicit momentum source term | chris_j_meyer | OpenFOAM Programming & Development | 3 | July 25, 2016 16:11 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 01:22 |
Suggestion for a new sub-forum at OpenFOAM's Forum | wyldckat | Site Help, Feedback & Discussions | 20 | October 28, 2014 09:04 |
Implicit source term and porousInterFoam | Andrea_85 | OpenFOAM Programming & Development | 0 | August 30, 2013 04:30 |