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

Implementing equation with two unknowns

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By test1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2021, 04:30
Question Implementing equation with two unknowns
  #1
New Member
 
anonymous
Join Date: Dec 2018
Posts: 4
Rep Power: 7
test1 is on a distinguished road
Hi,

I´m struggling with the implementation of an equation into my own OpenFoam-Solver.
I´ve got two equations like this:
ddt(X) + div(n1) = -Q
ddt(Y) + div(n2) = Q

X, Y and Q are unknowks; n1 and n2 are knows.

To avoid the calculation of Q I would like to equalize the equations

ddt(X) + ddt(Y) + div(n1) + div (n2) = 0

this gives me an equation with the two unknows X and Y.

Now I would like to solve this equation by inserting a value for X, calculate Y and repeate this procedure till I have a result of this equation.

Is there a way to do something like this in OpenFoam?
Actual I have no Idea how to type in an equation with two unknows and I´m not sure if this plan is a good idea, because I think this could result in an instable solver.

I will be glad, if you have some tips for me.
test1 is offline   Reply With Quote

Old   February 22, 2021, 07:45
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
I think that you have a problem here - you have 2 equations and 3 unknowns ... or 1 equation and 2 unknowns if you get rid of Q. You can't solve this! You need another equation.

You can solve Y for a given value of X, or vice versa, but there is no single solution of X and Y given just one equation.
Tobermory is offline   Reply With Quote

Old   February 22, 2021, 08:35
Default
  #3
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
<for some reason the same message posted twice ... can't delete this duplicate one>

Last edited by Tobermory; February 23, 2021 at 04:06.
Tobermory is offline   Reply With Quote

Old   February 22, 2021, 12:08
Default
  #4
New Member
 
Giovanni Luddeni
Join Date: Jan 2021
Posts: 14
Rep Power: 5
gionni is on a distinguished road
Quote:
Originally Posted by test1 View Post

Now I would like to solve this equation by inserting a value for X, calculate Y and repeate this procedure till I have a result of this equation.
What you are saying is that you would like to solve iteratively the system, or the equation in x and y. To do so, you give a value of x and you get a value of y; when do you consider yourself satisfied? Basically you need a relation for x and y that determines that that solution is ok. So that's your 3rd equation.
Find the criterion, write it as an equation and you can close the system.

Hope it helps!
gionni is offline   Reply With Quote

Old   February 23, 2021, 01:34
Thumbs up
  #5
New Member
 
anonymous
Join Date: Dec 2018
Posts: 4
Rep Power: 7
test1 is on a distinguished road
Thanks Tobermory and gionni,

I´m going to look for the relation of X and Y to close the system.
Your completely right that I need the third equation to make sure that the pair of X and Y are the correct pair that I need.

Thanks for your help and the food of thought.
Tobermory likes this.
test1 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
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
Problem with Velocity Poisson Equation and Vector Potential Poisson Equation mykkujinu2201 Main CFD Forum 1 August 12, 2017 13:15
implementing this equation sambatra OpenFOAM Running, Solving & CFD 9 August 27, 2009 08:55
Need help:about energy equation in CFX Stein CFX 4 July 2, 2009 22:31
Diffusion Equation izardy amiruddin Main CFD Forum 2 July 4, 2002 08:14


All times are GMT -4. The time now is 12:58.