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 Jun 24, 2024, 4:10 p.m. EDT
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 months ago Jun 17, 2024, 1:47 p.m. EDT
Updated: 5 months ago Jun 17, 2024, 3:33 p.m. EDT

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: 5 months ago Jun 17, 2024, 4:51 p.m. EDT
Updated: 5 months ago Jun 17, 2024, 4:51 p.m. EDT

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: 5 months ago Jun 18, 2024, 1:50 p.m. EDT

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: 5 months ago Jun 18, 2024, 3:20 p.m. EDT

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: 4 months ago Jun 24, 2024, 4:10 p.m. EDT

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 the discussion forum rules before posting.

Please log in to 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 the Support Center for a more comprehensive response from the Technical Support team.