Solve a PDE with a 1D domain with several equations that must be satisfied

Please login with a confirmed email address before reporting spam

Hi Jeff,

Thank you very much.

Most of the variations of my problem with respect to the one I present are coefficients, with 1 appearing or a constant "beta" appearing as it does not affect the implementation. But it is true that P as a function of c changes enough that we cannot explicitly put c as a function of P and this makes the direct resolution of the PDE impossible.

In summary, my problem, without considering coefficients, would be the following:

Thank you very much!

Best, Andres


5 Replies Last Post 2024年6月24日 GMT+2 22:10
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 3 months ago 2024年6月17日 GMT+2 19:47
Updated: 3 months ago 2024年6月17日 GMT+2 21:33

Hi Andres,

It seems that you need at least one more equation to define C.

Also, I note that the initial value of P is inconsistent with the boundary conditions. Are you trying to make P ramp up quickly at one end and drop at the other at t=0 (If so, you could use one of the available functions to achieve that effect)? Something else?

Jeff

-------------------
Jeff Hiller
Hi Andres, It seems that you need at least one more equation to define C. Also, I note that the initial value of P is inconsistent with the boundary conditions. Are you trying to make P ramp up quickly at one end and drop at the other at t=0 (If so, you could use one of the available functions to achieve that effect)? Something else? Jeff

Please login with a confirmed email address before reporting spam

Posted: 3 months ago 2024年6月17日 GMT+2 22:51
Updated: 3 months ago 2024年6月17日 GMT+2 22:51

Hi Jeff,

Thank you for your quick response.

It is true that I am generating a "shock" by imposing boundary conditions that are different from the initial condition. But this is something I'm looking for. I know that numerically it could cause problems but in that case I will introduce a function to smooth the relationship between the initial condition and the boundary conditions. Anyway, this part doesn't worry me.

What I'm looking for is how to solve this PDE with the multiple functions that establish relationships between variables. The case I present is a very simplified version of my problem. But if there was a way to implement this PDE with these functions in COMSOL, it would be very useful to me. I think the problem is well defined. I'm going to rewrite it trying to make almost everything explicit in P which is the variable I'm trying to resolve:

We substitute U and V into the differential equation and it remains:

Substituting n into the differential equation we get an equation like this:

We almost have the PDE in the form of an explicit expression in P. This way it would be easy to solve it with COMSOL, but the problem is that in my real case I can't really solve for c in terms of P (here I could). And in any case the idea is that given an EDP with a series of functions that establish relationships between variables, how can they be implemented in COMSOL? Jeff, you have to excuse me because I think what caused you confusion is the C that I capitalized. It is incorrect. Thank you very much for your attention and I would appreciate any suggestions and help to solve an equation like this.

Sincerely, Andres

Hi Jeff, Thank you for your quick response. It is true that I am generating a "shock" by imposing boundary conditions that are different from the initial condition. But this is something I'm looking for. I know that numerically it could cause problems but in that case I will introduce a function to smooth the relationship between the initial condition and the boundary conditions. Anyway, this part doesn't worry me. What I'm looking for is how to solve this PDE with the multiple functions that establish relationships between variables. The case I present is a very simplified version of my problem. But if there was a way to implement this PDE with these functions in COMSOL, it would be very useful to me. I think the problem is well defined. I'm going to rewrite it trying to make almost everything explicit in P which is the variable I'm trying to resolve: We substitute U and V into the differential equation and it remains: \frac{\partial (c+n)}{\partial t}+\frac{\partial}{\partial x}(\frac{\partial P}{\partial x}\times c)=0 P=\frac{1}{\frac{1}{c}-1}=\frac{c}{1-c} n=\frac{P}{1+P} Substituting n into the differential equation we get an equation like this: \frac{\partial }{\partial t}(c+\frac{P}{1+P})+\frac{\partial}{\partial x}(\frac{\partial P}{\partial x}\times c)=0 P=\frac{c}{1-c} We almost have the PDE in the form of an explicit expression in P. This way it would be easy to solve it with COMSOL, but the problem is that in my real case I can't really solve for c in terms of P (here I could). And in any case the idea is that given an EDP with a series of functions that establish relationships between variables, how can they be implemented in COMSOL? Jeff, you have to excuse me because I think what caused you confusion is the C that I capitalized. It is incorrect. Thank you very much for your attention and I would appreciate any suggestions and help to solve an equation like this. Sincerely, Andres

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 3 months ago 2024年6月18日 GMT+2 19:50

Hello Andres,

It seem sthat with the equations you picked, you also have c=n=P/(1+P), and you could indeed express the PDE in terms of P only, leading hopefully to a relatively quick set up and solution in COMSOL.

But since you expressed that your real problem is more complex, perhaps you should discuss it directly - otherwise you may be given advice that does not carry over to your actual problem.

Best,

Jeff

-------------------
Jeff Hiller
Hello Andres, It seem sthat with the equations you picked, you also have c=n=P/(1+P), and you could indeed express the PDE in terms of P only, leading hopefully to a relatively quick set up and solution in COMSOL. But since you expressed that your real problem is more complex, perhaps you should discuss it directly - otherwise you may be given advice that does not carry over to your actual problem. Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 3 months ago 2024年6月18日 GMT+2 21:20

Hi Jeff,

Thank you very much.

Most of the variations of my problem with respect to the one I present are coefficients, with 1 appearing or a constant "beta" appearing as it does not affect the implementation. But it is true that P as a function of c changes enough that we cannot explicitly put c as a function of P and this makes the direct resolution of the PDE impossible.

In summary, my problem, without considering coefficients, would be the following:

Thank you very much!

Best, Andres

Hi Jeff, Thank you very much. Most of the variations of my problem with respect to the one I present are coefficients, with 1 appearing or a constant "beta" appearing as it does not affect the implementation. But it is true that P as a function of c changes enough that we cannot explicitly put c as a function of P and this makes the direct resolution of the PDE impossible. In summary, my problem, without considering coefficients, would be the following: \frac{\partial U}{\partial t} + \frac{\partial}{\partial x} (V \times c) = 0 U=c+n V=\frac{\partial P}{\partial x} P=\frac{1}{\frac{1}{c}-1}-\frac{1}{\frac{1}{c^2}+\frac{1}{c}} n=\frac{P}{1+P} P_{ini}=1.5; P_{x=0}=4;P_{x=L}=0.1 Thank you very much! Best, Andres

Please login with a confirmed email address before reporting spam

Posted: 2 months ago 2024年6月24日 GMT+2 22:10

Hi,

I'm still not able to solve the problem I started this thread with.

As Jeff recommended, I have outlined the exact problem I want to solve. In this problem the dependent variable is P (physically a pressure), and the independent variables are time (t) and a geometric dimension (z). The problem is 1D.

The boundary and initial conditions would be those indicated.

Everything other than P, z or t are constants that depend on the physics of the problem.

Thank you very much for your help.

All the best Andres

Hi, I'm still not able to solve the problem I started this thread with. \frac{\partial (\phi c)}{\partial t} + \frac{\partial \left[(1 - \phi) n \right]}{\partial t} + \frac{\partial (u c)}{\partial z} = 0, n= n^\infty \frac{ bP}{1 +P b}, u = - \frac{k}{\mu} \frac{\partial P}{\partial z}, P = \frac{RT}{\frac{1}{c} - b} - \frac{a \alpha}{(\frac{1}{c})^2 + 2b\frac{1}{c} - b^2}, a = \frac{0.45723553 R^2 T_c^2}{P_c}, b = \frac{0.07779607 RT_c}{P_c}, \alpha = \left(1 + \left(0.37464 + 1.54226 \omega - 0.26992 \omega^2 \right) \left(1 - T_r^{0.5} \right) \right)^2, T_r = \frac{T}{T_c}, P_{ini}=1.5; P_{x=0}=4;P_{x=L}=0.1. As Jeff recommended, I have outlined the exact problem I want to solve. In this problem the dependent variable is P (physically a pressure), and the independent variables are time (t) and a geometric dimension (z). The problem is 1D. The boundary and initial conditions would be those indicated. Everything other than P, z or t are constants that depend on the physics of the problem. Thank you very much for your help. All the best Andres

Reply

Please read thediscussion forum rulesbefore posting.

Pleaselog into post a reply.

Note that while COMSOL employees may participate in the discussion forum, COMSOL®software users who are on-subscription should submit their questions via theSupport Centerfor a more comprehensive response from the Technical Support team.

Baidu
map