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

How to solve given equation only in part of calculation area?

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   March 28, 2019, 00:09
Default How to solve given equation only in part of calculation area?
  #1
New Member
 
Zhanyuan Wang
Join Date: Sep 2018
Location: China
Posts: 9
Rep Power: 7
Zhanyuan Wang is on a distinguished road
Hello foamers,

I want to add a set of scalar transport equation (consists of two equations) in VOF model (compressibleInterFoam). Here I call them Y1Eqn and Y2Eqn, where Y1 and Y2 are iterative variables. These two equations need to be solved in different phase area separately, that is to say, Y1Eqn is solved and Y2Eqn is set to zero when the value of volScalarField alpha1 is not zero (which means the 1st phase), and the same operation is done in the 2nd phase. The thought of such equations is listed in attachment below.

So is there anyone who can tell me how can I achieve this goal?

I thought up a solution but i dont know whether it is right. Firstly i multiplied the equation with alpha1, something like:

fvScalarMatrix Y1Eqn
(
alpha1*(fvm::ddt() + fvm:: () - fvm::laplacian() + source term)
)

but when i run the case it broke up at the first time step. Later i find the problem: it is not allowed to multiply fvm terms with a field whose value has the probability of being zero, and volScalarField alpha1 is exactly such a field(But i dont know why it is not allowed, anyone can explain it to me?). So I modified my equation later on by changing the fvm terms to fvc terms, something like:

fvScalarMatrix Y1Eqn
(
fvm::ddt() + alpha1*fvc:: () - alpha1*fvc::laplacian() + source term
)

I m not sure the influence of using fvc instead of fvm in convection terms and diffusion terms and what is the difference between these two methods. Can i achieve my goal by this method? Can anyone explain it to me?

I am sincerely grateful for anyone who can offer any information. Thanks very much.
Attached Images
File Type: jpg L$EA}`YCT@1OIH{P03~B_$E.jpg (86.0 KB, 20 views)
Zhanyuan Wang is offline   Reply With Quote

 

Tags
compressibleinterfoam, multiphase, transport equation, vof


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
solve equation with fluent thomas007 FLUENT 0 September 28, 2016 08:10
Stress Equation and Implicit part Tobi OpenFOAM 1 July 13, 2016 06:25
Non overlap area fractions saisanthoshm88 CFX 11 September 17, 2015 18:42
solve an implicit equation in UDF Rui_27 Fluent UDF and Scheme Programming 0 September 8, 2014 10:12
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32


All times are GMT -4. The time now is 17:37.