|
[Sponsors] |
Forcing the value of a point in internal Domain to remain fixed. |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 16, 2017, 03:10 |
Forcing the value of a point in internal Domain to remain fixed.
|
#1 |
Member
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10 |
Hello dear Foamers,
I am developing a twophase flow solver where I solve species balance (binary mixture) for both phases; YlEqn and YgEqn. Lets take the YgEqn as an example: Code:
fvScalarMatrix YgEqn ( fvm::ddt(alpha2*rho2, yg) + fvm::div(rho2Phialpha2, yg, "div(rhoPhiAlpha,yg)") - fvm::laplacian(alpha2*rho2*Dg, yg) ); ygEqn.relax(); ygEqn.solve(); what I want to do now is to force yg to be equal to ygi (which I calculate from an external function) on the interface. so basically it is like a fixed value boundary condition, but inside the domain and not on the boundary. the good point is that I know where inside the domain and which cell, but I am not sure how I should force it's value to remain constant and not be affected by the other cells. Any hint would be really appreciated. |
|
April 16, 2017, 07:13 |
|
#2 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
Possibly, ExplicitSetValue is what you need.
Code:
fvScalarMatrix YgEqn ( fvm::ddt(alpha2*rho2, yg) + fvm::div(rho2Phialpha2, yg, "div(rhoPhiAlpha,yg)") - fvm::laplacian(alpha2*rho2*Dg, yg) == fvOptions(rho, yg) ); fvOptions.constrain(YgEqn); ygEqn.relax(); ygEqn.solve(); |
|
April 17, 2017, 05:09 |
|
#3 | |
Member
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10 |
Quote:
Thank you so much for your reply, I actually thought of that at the beginning, but the point is that these values of Ygi are a function of P and T and I solve also energy equation and these values should get updated on runtime after energy equation is solved in each timestep. Yg[celli]=Function_Ygi(T[celli],p[celli]) where celli is the index of the cells where there is interface. So I need to force the values of Yg to be Ygi from the solver. Can you think of any way to revise the YgEgn in the solver to do that? Once again I really appreciate your help. Happy Easter |
||
April 18, 2017, 13:42 |
How about this?
|
#4 |
Member
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10 |
I figured out something but I am not sure if it is correct or not, I read on another post that this should work like this by using "setValues":
Code:
fvScalarMatrix ygEqn ( fvm::ddt(alpha2*rho2, yg) + fvm::div(rho2Phialpha2, yg, "div(rhoPhiAlpha,yg)") - fvm::laplacian(alpha2*rho2*Dg, yg) ); forAll(alpha2,celli){ if ( alpha2[celli] != 0 && alpha2[celli] != 1) { label ref = celli; labelList refCells (1,ref); scalarField refValues (1, ygi[celli]); ygEqn.setValues(refCells, refValues); } } ygEqn.relax(); ygEqn.solve(); Any idea what am I doing wrong? Code:
forAll(alpha2,celli){ Info << " alpha2 = " << alpha2[celli] << " yg = " << yg[celli] << " =? ygi = " << ygi[celli] << endl; } |
|
April 21, 2017, 15:23 |
|
#5 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
What is the code between the snippets from your latest post? ygi might somehow be modified there or something?
|
|
April 22, 2017, 09:45 |
|
#6 | |
Member
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10 |
Quote:
Thank you so much |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 07:38 |
Monte Carlo Simulation: H-Energy is not convergating & high Incident Radiation | volleyHC | CFX | 5 | April 3, 2016 05:41 |
Pressure distribution on a wall | darazsbence | CFX | 17 | October 6, 2015 10:38 |
Named selection for internal surfaces in the domain | Ahmed Saeed | CFX | 1 | November 20, 2013 09:32 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 12, 2001 23:19 |