CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

coupled equations

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 29, 2016, 07:22
Question coupled equations
  #1
Member
 
Join Date: Oct 2015
Location: montreal- canada
Posts: 46
Rep Power: 11
Mohammad Jam is on a distinguished road
Hi Foamers,

How to to solve coupled equations?
there are two variable A & B , which A is volVectorfield & B is volScalarField

fvm::ddt(A)+fvm::div(B)=0
fvm::laplacian(A)+fvm::grad(B)+source term=0

I.C.::
A= 0 for 0 < x < L when t = 0
B=20 for 0 < x < L when t = 0

B.C.
A = 0 for x = 0, L when t > 0
B=10 for x = 0 & T=30 for x = L when t > 0

Thanks in advance.
Mohammad Jam is offline   Reply With Quote

Old   September 29, 2016, 14:41
Default
  #2
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
Hi Mohammad,
What exactly do you mean by solving coupled equations?
Your equations could be solved as a system of equation in a coupled or non-coupled manner.
To solve them in a non-coupled manner you can find one of the simpler solvers (such as the cases in the test directory) and modify it so it solves your equations. This is the easier approach.
To solve them in a coupled manner you need to solve the linear system of equation for all of the variables at once (usually not very favourable in CFD due to big size of the problem). Since your equations are not similar the only way comes to my mind is to modify some of the solvers and overload the matrix coefficient formation so it includes all of them, which is quiet complicated and time consuming.
anishtain4 is offline   Reply With Quote

Old   September 29, 2016, 19:02
Default
  #3
Member
 
Join Date: Oct 2015
Location: montreal- canada
Posts: 46
Rep Power: 11
Mohammad Jam is on a distinguished road
Quote:
Originally Posted by anishtain4 View Post
Hi Mohammad,
What exactly do you mean by solving coupled equations?
Your equations could be solved as a system of equation in a coupled or non-coupled manner.
To solve them in a non-coupled manner you can find one of the simpler solvers (such as the cases in the test directory) and modify it so it solves your equations. This is the easier approach.
To solve them in a coupled manner you need to solve the linear system of equation for all of the variables at once (usually not very favourable in CFD due to big size of the problem). Since your equations are not similar the only way comes to my mind is to modify some of the solvers and overload the matrix coefficient formation so it includes all of them, which is quiet complicated and time consuming.
Hi Mahdi , thanks for your kind response

you are right, this is a system of equation and no need to solve them simultaneously .
A refers to volScalarField and B refers to volVectorField

i just need to get "A" but there is "B" in equations too .

i think its a kind of series coupled equation! i mean i should find variable ''B'' from first equation and put it in second equation to find variable "A".
Mohammad Jam is offline   Reply With Quote

Old   September 29, 2016, 19:15
Default
  #4
Member
 
Join Date: Oct 2015
Location: montreal- canada
Posts: 46
Rep Power: 11
Mohammad Jam is on a distinguished road
Quote:
Originally Posted by anishtain4 View Post
To solve them in a non-coupled manner you can find one of the simpler solvers (such as the cases in the test directory) and modify it so it solves your equations. This is the easier approach.
.
i am working with chtMultiregionFoam solver and implementation of these Eq. is my problem because when i implement them it gives some unwanted errors because it doesnt allow to put two passive variable in one equation.

Best regards,
Mohammad
Mohammad Jam is offline   Reply With Quote

Old   September 30, 2016, 12:32
Default
  #5
Member
 
Join Date: Oct 2015
Location: montreal- canada
Posts: 46
Rep Power: 11
Mohammad Jam is on a distinguished road
Quote:
Originally Posted by anishtain4 View Post
Hi Mohammad,
What exactly do you mean by solving coupled equations?
Your equations could be solved as a system of equation in a coupled or non-coupled manner.
To solve them in a non-coupled manner you can find one of the simpler solvers (such as the cases in the test directory) and modify it so it solves your equations. This is the easier approach.
To solve them in a coupled manner you need to solve the linear system of equation for all of the variables at once (usually not very favourable in CFD due to big size of the problem). Since your equations are not similar the only way comes to my mind is to modify some of the solvers and overload the matrix coefficient formation so it includes all of them, which is quiet complicated and time consuming.
Dear Mahdi,

implementation of grad and div schemes is not allowed by chtMultiRegionFoam solver !! ,
any hint or idea is welcome.
Mohammad Jam is offline   Reply With Quote

Old   September 30, 2016, 12:33
Default
  #6
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
The general case is no different than NS and continuity equation!
1. Set initial condition
2. Solve Eq. 1, then solve Eq. 2
3. Repeat step 2 until desired error is low
4. move to the next step.

You can check pimpleFoam or pisoFoam as they do the same thing for momentum and pressure correction steps.
anishtain4 is offline   Reply With Quote

Old   September 30, 2016, 12:40
Default
  #7
Member
 
Join Date: Oct 2015
Location: montreal- canada
Posts: 46
Rep Power: 11
Mohammad Jam is on a distinguished road
Quote:
Originally Posted by anishtain4 View Post
The general case is no different than NS and continuity equation!
1. Set initial condition
2. Solve Eq. 1, then solve Eq. 2
3. Repeat step 2 until desired error is low
4. move to the next step.

You can check pimpleFoam or pisoFoam as they do the same thing for momentum and pressure correction steps.
thats exactly true, but my problem is div and grad scheme doesnt allow to compile .
when i change the schemes to e.g. ddt or laplacian , the solver compile correctly and without error.
should i use any algorithm like piso or simple?

best regards
Mohammad Jam is offline   Reply With Quote

Old   September 30, 2016, 12:52
Default
  #8
Member
 
Join Date: Oct 2015
Location: montreal- canada
Posts: 46
Rep Power: 11
Mohammad Jam is on a distinguished road
Quote:
Originally Posted by anishtain4 View Post
The general case is no different than NS and continuity equation!
1. Set initial condition
2. Solve Eq. 1, then solve Eq. 2
3. Repeat step 2 until desired error is low
4. move to the next step.

You can check pimpleFoam or pisoFoam as they do the same thing for momentum and pressure correction steps.
May i email you my solver and you take a look ?
Mohammad Jam is offline   Reply With Quote

Old   September 30, 2016, 13:11
Default
  #9
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
------------- paste in wrong post--------------
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)

Last edited by nimasam; September 30, 2016 at 14:47. Reason: wrong post
nimasam is offline   Reply With Quote

Old   September 30, 2016, 13:30
Default
  #10
Member
 
Join Date: Oct 2015
Location: montreal- canada
Posts: 46
Rep Power: 11
Mohammad Jam is on a distinguished road
Quote:
Originally Posted by nimasam View Post
following syntax:
Code:
typedef typename Foam::KinematicParcel<Foam::particle> parcelType ;

forAllIter( basicNewKinematicCloud , kinematicCloud, iter)
{
    parcelType& p = iter(); //paticle
   kinematicCloud.deleteParticle(p);
}
Dear nima,
i couldnt found what you hint!!
where should i implement this syntax?
Mohammad Jam is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Coupled System of Equations MissCFD CFX 6 June 1, 2016 15:12
Problem modelling potential equations with addtional variables pmtgt CFX 4 October 3, 2013 09:20
modelling Differential equations in a udf RikardMNorén Fluent UDF and Scheme Programming 2 October 1, 2013 04:36
Solver Equations Carola CFX 9 August 12, 2003 09:27
Scalar Transport Equations 123 Main CFD Forum 6 August 10, 1998 10:05


All times are GMT -4. The time now is 21:08.