Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
how to write an user defined PDE?
Posted 25.08.2014, 03:48 GMT-4 Fluid & Heat, Heat Transfer & Phase Change Version 4.2 15 Replies
Please login with a confirmed email address before reporting spam
I am trying to write a PDE as attached. I have tried with the "coefficient form of PDE" physics, but, I am unable to write down the first term in right hand side of the equation (see attached file). Can anyone help me to complete the equation using "coefficient form of PDE" physics?
Thanking you in advance
Anup
Attachments:
Please login with a confirmed email address before reporting spam
simply use utx as the term in flux in general form.
Please login with a confirmed email address before reporting spam
1) You can express that term with partial derivatives. You can write derivatives in Comsol as shown in the previous post or by using the d(,) function.
After making your expression you can put it in the force term or if convenient, or more logical, somewhere else.
2) You might turn this single equation into two coupled equations by defining a second variable as the derivative of u. This definition is your second equation and the second variable can be filled into you original equation such that you can easily use the coefficient form. The advantage would be that you don't hack or abuse the coefficient form module be putting derivatives into it and changing the meaning of the coefficients.
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
Thanks for your suggestion. But, I am sorry I could not understand 'utx'. The variable 'u' is a function of three space coordinates and time. How to incorporate (grad)^2 in "coefficient form of PDE" physics?
regards
Anup
Please login with a confirmed email address before reporting spam
Thanks for the reply. That's fine if I use utx, uty and utz in conservative flux in "general form PDE- physics". But then, I have two issues:
(A) The first term in the RHS of my equation (see attachment) also contain a coefficient 'X4'. How to incorporate that?
(B) If I write utx, uty, utz; that represents derivative of u with respect to (t,x), (t,y), (t,z) respectively. But, the third term in the LHS of my equation contains second order derivative of u with respect to (x, y, z ) not a derivative of 't'. How to take care that? Moreover, the third term in the LHS of my equation also contains a coefficient 'X3'.
Thanks in advance
Anup
Attachments:
Please login with a confirmed email address before reporting spam
1) I though X values are constant and are not depending on x,y,z. If X values are also scalar fields, then you need to expand you equations and put the remaining terms as f. But if X4 is constant then just put is with the other term in flux .
2) second derivatives of space also will go to the flux term (as ux, uy , uz ,....). so add these term to the previous terms in the flux.
You need to play with the terms a little bit, but finally put the remaining terms as f.
Please login with a confirmed email address before reporting spam
I got it, how to incorporate the coefficient 'X4'.
Please help me for second question.
Thank you in advance
Anup
Please login with a confirmed email address before reporting spam
You need to add ux in the first flux, uy is the second and so forth. Gamma sign mean derivative, it will apply to the ux and make a uxx.
Best,
Hossein
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
Thanks once again. What I have understood from your reply is attached with this message. Please see the attachment and reply me if my understanding is correct.
Thank you in advance
Anup
Attachments:
Please login with a confirmed email address before reporting spam
But....I have observed..... using "coefficient form PDE" in my problem will be a difficult one...and hence now I am trying "General form PDE"
regards
Anup
Please login with a confirmed email address before reporting spam
It seems like you got the points. Except I think you forgot the X3 and X4 in the last two equations, but then they are constants and you can include them in any field.
Also for utx or uxt you can write: d(d(u,x),t)
Good luck,
Hossein
Please login with a confirmed email address before reporting spam
If X3 is a variable then you get X3 (uxx + uyy + uzz) + (X3x ux +X3y uy +X3z uz).
I recommend you try to study this mathematics because simply taking over the formulas will get you a model that you don't understand.
Note that the divergence is a vector operator. Div u, with u a scalar, results in a vector {ux,uy,uz}. div div u is the dot product of two vectors and results again in a scalar {dx,dy,dz}*{ux,uy,uz} = (uxx+uyy+uzz}. With div ( c div u) you get also a dot product {dx,dy,dz}{c ux, c uy, c uz} = dx (c ux) + dy (c uy) + dz (c uz).
Please login with a confirmed email address before reporting spam
with regards
Anup
Please login with a confirmed email address before reporting spam
with regards
Anup
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.
Suggested Content
- KNOWLEDGE BASE LDAP configuration for a Model Manager server using Apache Directory Studio
- BLOG Image Denoising and Other Multidimensional Variational Problems
-
KNOWLEDGE BASE
How can I see the equations COMSOL is defining?
How do I implement a user-defined Multiphysics coupling? - FORUM Error in user-defined Analytic function
- KNOWLEDGE BASE Error: An error has occurred. See the log file C:\Users...