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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
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

Old   March 28, 2019, 06:45
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

Code:
fvm:: Implicit
fvc:: Explicit
Can you please tell us which error message you got and the complete equation you are solving?
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 28, 2019, 08:33
Default
  #3
New Member
 
Zhanyuan Wang
Join Date: Sep 2018
Location: China
Posts: 9
Rep Power: 7
Zhanyuan Wang is on a distinguished road
Hi Tobi,
thank you for your reply!

the error message is as follows:
Code:
[12] #0  Foam::error::printStack(Foam::Ostream&)[16] #0  Foam::error::printStack(Foam::Ostream&)[10] #0  Foam::error::printStack(Foam::Ostream&)[14] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
[12] #1  Foam::sigFpe::sigHandler(int)[13] #0  Foam::error::printStack(Foam::Ostream&)[7] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
[16] #1  Foam::sigFpe::sigHandler(int)[4] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
[10] #1  Foam::sigFpe::sigHandler(int) at ??:?
[12] #2  ? at ??:?
 at ??:?
[13] #1  Foam::sigFpe::sigHandler(int)[14] #1  Foam::sigFpe::sigHandler(int)[5] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
[7] #1  Foam::sigFpe::sigHandler(int)[1] #0  Foam::error::printStack(Foam::Ostream&)[3] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
 at ??:?
[16] #2  ?[4] #1  Foam::sigFpe::sigHandler(int) in "/lib/x86_64-linux-gnu/libc.so.6"
[12] #3  ? at ??:?
[10] #2  ? at ??:?
[5] #1  Foam::sigFpe::sigHandler(int) at ??:?
[13] #2  ? at ??:?
[14] #2  ? at ??:?
[7] #2  ? in "/lib/x86_64-linux-gnu/libm.so.6"
[12] #4   at ??:?
pow[1] #1  Foam::sigFpe::sigHandler(int) in "/lib/x86_64-linux-gnu/libc.so.6"
[16] #3  ? in "/lib/x86_64-linux-gnu/libc.so.6"
[10] #3  ? in "/lib/x86_64-linux-gnu/libc.so.6"
[13] #3  ? at ??:?
[4] #2  ? at ??:?
[3] #1  Foam::sigFpe::sigHandler(int) in "/lib/x86_64-linux-gnu/libc.so.6"
[14] #3  ? at ??:?
[5] #2  ? in "/lib/x86_64-linux-gnu/libm.so.6"
[10] #4  pow in "/lib/x86_64-linux-gnu/libm.so.6"
 in "/lib/x86_64-linux-gnu/libc.so.6"
[7] #3  ?[12] #5  Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const in "/lib/x86_64-linux-gnu/libm.so.6"
[13] #4  pow in "/lib/x86_64-linux-gnu/libm.so.6"
[16] #4  pow in "/lib/x86_64-linux-gnu/libc.so.6"
[4] #3  ? at ??:?
[1] #2  ? in "/lib/x86_64-linux-gnu/libm.so.6"
[10] #5  Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const in "/lib/x86_64-linux-gnu/libm.so.6"
[14] #4  pow in "/lib/x86_64-linux-gnu/libm.so.6"
[7] #4  pow in "/lib/x86_64-linux-gnu/libm.so.6"
[13] #5  Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const in "/lib/x86_64-linux-gnu/libc.so.6"
[5] #3  ? at ??:?
[12] #6  Foam::PengRobinsonGas<Foam::specie>::Cp(double, double) const at ??:?
[3] #2  ? in "/lib/x86_64-linux-gnu/libm.so.6"
[16] #5  Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const in "/lib/x86_64-linux-gnu/libm.so.6"
[4] #4  pow in "/lib/x86_64-linux-gnu/libc.so.6"
[1] #3  ? at ??:?
[10] #6  Foam::PengRobinsonGas<Foam::specie>::Cp(double, double) const in "/lib/x86_64-linux-gnu/libm.so.6"
[14] #5  Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const in "/lib/x86_64-linux-gnu/libm.so.6"
[7] #5  Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const at ??:?
[13] #6  Foam::PengRobinsonGas<Foam::specie>::Cp(double, double) const in "/lib/x86_64-linux-gnu/libc.so.6"
[3] #3  ? in "/lib/x86_64-linux-gnu/libm.so.6"
[5] #4  pow in "/lib/x86_64-linux-gnu/libm.so.6"
[1] #4  pow in "/lib/x86_64-linux-gnu/libm.so.6"
[4] #5  Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const at ??:?
[12] #7  Foam::heThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::Cv() const at ??:?
[16] #6  Foam::PengRobinsonGas<Foam::specie>::Cp(double, double) const at ??:?
[10] #7  Foam::heThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::Cv() const at ??:?
[14] #6  Foam::PengRobinsonGas<Foam::specie>::Cp(double, double) const at ??:?
[7] #6  Foam::PengRobinsonGas<Foam::specie>::Cp(double, double) const in "/lib/x86_64-linux-gnu/libm.so.6"
[5] #5  Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const at ??:?
[13] #7  Foam::heThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::Cv() const in "/lib/x86_64-linux-gnu/libm.so.6"
[1] #5  Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const in "/lib/x86_64-linux-gnu/libm.so.6"
[3] #4  pow at ??:?
[12] #8   at ??:?
[10] #8   at ??:?
[4] #6  Foam::PengRobinsonGas<Foam::specie>::Cp(double, double) const at ??:?
[16] #7  Foam::heThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::Cv() const at ??:?
[7] #7  Foam::heThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::Cv() const at ??:?
[5] #6  Foam::PengRobinsonGas<Foam::specie>::Cp(double, double) const at ??:?
[13] #8   at ??:?
[1] #6  Foam::PengRobinsonGas<Foam::specie>::Cp(double, double) const at ??:?
[14] #7  Foam::heThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::Cv() const in "/lib/x86_64-linux-gnu/libm.so.6"
[3] #5  Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const?? at ??:?
[4] #7  Foam::heThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::Cv() const at ??:?
[5] #7  Foam::heThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::Cv() const at ??:?
[16] #8  ? at ??:?
[7] #8   at ??:?
[1] #7   at ??:?
[10] #9  __libc_start_mainFoam::heThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::Cv() const at ??:?
[12] #9  __libc_start_main at ??:?
[14] #8   at ??:?
[3] #6  Foam::PengRobinsonGas<Foam::specie>::Cp(double, double) const? at ??:?
[4] #8   at ??:?
[13] #9  __libc_start_main at ??:?
[5] #8   in "/lib/x86_64-linux-gnu/libc.so.6"
[12] #10  ? in "/lib/x86_64-linux-gnu/libc.so.6"
[10] #10   at ??:?
[1] #8  ? at ??:?
[7] #9  __libc_start_main at ??:?
[3] #7  Foam::heThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::Cv() const???? in "/lib/x86_64-linux-gnu/libc.so.6"
[13] #10   at ??:?
[16] #9  __libc_start_main? at ??:?
[14] #9  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
[7] #10   at ??:?
[5] #9  __libc_start_main at ??:?
[wzy-Precision-Tower-7810:19333] *** Process received signal ***
[wzy-Precision-Tower-7810:19333] Signal: Floating point exception (8)
[wzy-Precision-Tower-7810:19333] Signal code:  (-6)
[wzy-Precision-Tower-7810:19333] Failing at address: 0x3e800004b85
[wzy-Precision-Tower-7810:19333] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x354b0)[0x7f9b8b5624b0]
[wzy-Precision-Tower-7810:19333] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f9b8b562428]
[wzy-Precision-Tower-7810:19333] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x354b0)[0x7f9b8b5624b0]
[wzy-Precision-Tower-7810:19333] [ 3] /lib/x86_64-linux-gnu/libm.so.6(+0x12601)[0x7f9b8bb1f601]
[wzy-Precision-Tower-7810:19333] [ 4] /lib/x86_64-linux-gnu/libm.so.6(pow+0x14)[0x7f9b8bb2ee54]
[wzy-Precision-Tower-7810:19333] [ 5]  at ??:?
[wzy-Precision-Tower-7810:19335] *** Process received signal ***
[wzy-Precision-Tower-7810:19335] Signal: Floating point exception (8)
[wzy-Precision-Tower-7810:19335] Signal code:  (-6)
[wzy-Precision-Tower-7810:19335] Failing at address: 0x3e800004b87
/home/wzy/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so(_ZNK4Foam15PengRobinsonGasINS_6specieEE1ZEdd+0x1b9)[0x7f9b915bd4b9]
[wzy-Precision-Tower-7810:19333] [ 6] /home/wzy/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so(_ZNK4Foam15PengRobinsonGasINS_6specieEE2CpEdd+0x122)[0x7f9b915c1e92]
[wzy-Precision-Tower-7810:19333] [ 7] [wzy-Precision-Tower-7810:19335] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x354b0)[0x7f5bb613b4b0]
[wzy-Precision-Tower-7810:19335] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f5bb613b428]
[wzy-Precision-Tower-7810:19335] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x354b0)[0x7f5bb613b4b0]
[wzy-Precision-Tower-7810:19335] [ 3] /lib/x86_64-linux-gnu/libm.so.6(+0x12601)[0x7f5bb66f8601]
[wzy-Precision-Tower-7810:19335] [ 4] /lib/x86_64-linux-gnu/libm.so.6(pow+0x14)[0x7f5bb6707e54]
[wzy-Precision-Tower-7810:19335] [ 5] /home/wzy/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so(_ZNK4Foam8heThermoINS_9rhoThermoENS_11pureMixtureINS_14constTransportINS_7species6thermoINS_12hConstThermoINS_15PengRobinsonGasINS_6specieEEEEENS_22sensibleInternalEnergyEEEEEEEE2CvEv+0x23c)[0x7f9b916d4acc]
[wzy-Precision-Tower-7810:19333] [ 8] myCompressibleInterFoam[0x44c187]
[wzy-Precision-Tower-7810:19333] [ 9] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f9b8b54d830]
[wzy-Precision-Tower-7810:19333] [10] myCompressibleInterFoam[0x4597b9]
[wzy-Precision-Tower-7810:19333] *** End of error message ***
/home/wzy/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so(_ZNK4Foam15PengRobinsonGasINS_6specieEE1ZEdd+0x1b9)[0x7f5bbc1964b9]
[wzy-Precision-Tower-7810:19335] [ 6] /home/wzy/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so(_ZNK4Foam15PengRobinsonGasINS_6specieEE2CpEdd+0x122)[0x7f5bbc19ae92]
[wzy-Precision-Tower-7810:19335] [ 7] /home/wzy/OpenFOAM/OpenFOAM-5.x/platforms/linux64GccDPInt32Opt/lib/libfluidThermophysicalModels.so(_ZNK4Foam8heThermoINS_9rhoThermoENS_11pureMixtureINS_14constTransportINS_7species6thermoINS_12hConstThermoINS_15PengRobinsonGasINS_6specieEEEEENS_22sensibleInternalEnergyEEEEEEEE2CvEv+0x23c)[0x7f5bbc2adacc]
[wzy-Precision-Tower-7810:19335] [ 8] myCompressibleInterFoam[0x44c187]
[wzy-Precision-Tower-7810:19335] [ 9] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f5bb6126830]
[wzy-Precision-Tower-7810:19335] [10] myCompressibleInterFoam[0x4597b9]
[wzy-Precision-Tower-7810:19335] *** End of error message ***
My problem is to add evaporation model in compressibleInterFoam and deal with the situation of droplet evaporation. So the governing equations are based on compressibleInterFoam. I just add source terms to continuity equation and energy equation(TEqn) and write a vapor mass fraction transport equation, remaining momentum equation unmodified. The whole equations are listed in attachment below, and i need to make some explanations towards it:

1. Y is the mass fraction of liquid phase vapor in gas phase caused by evaporation. I dont consider gas solubility so here is only one YEqn without Y2Eqn which solves gas mass fraction in liquid phase (but later on i will take it into account).

2. TEqn is based on the original one in compressibleInterFoam. I modify the equation as the way compressibleInterFoam do following another threads in cfdol:
Formulation in compressibleInterFoam
I am not sure if it is right modifying equation like this. So maybe my problem is caused by incorrect T equation.
Attached Images
File Type: png 14269434704e97ac1d138e5cd26900c.png (29.3 KB, 14 views)
Zhanyuan Wang is offline   Reply With Quote

Old   March 28, 2019, 08:48
Default
  #4
New Member
 
Zhanyuan Wang
Join Date: Sep 2018
Location: China
Posts: 9
Rep Power: 7
Zhanyuan Wang is on a distinguished road
Hi Tobi,
i wrongly post a reply to myself instead of you. You can look #3
And i tried for another time, it seems i can multiply fvm terms with alpha1. There is no error at the first time step. Maybe there is other mistakes before and now i correct it.
But after iteration for 3e-07s the solver still broke up. The error message is as post in #3.
Any suggestion will be helpful.
Zhanyuan Wang is offline   Reply With Quote

Reply

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 01:36.