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.
I want to know how to use built-in material property in PDE module
Posted 13.07.2010, 07:09 GMT-4 11 Replies
Please login with a confirmed email address before reporting spam
it's simple question
I simulate some model with PDE
but, i cannot get information from Material tab
For example, Materials -> Argon{mat1} -> Density(rho), Expression : rho(T)
How to use that value in the PDE?
Below is error code
Failed to evaluate expression.
- Expression: mat1.rho
Failed to evaluate variable.
- Variable: mat1.rho
- Global scope
I tried mat1.rho, mat.rho, mod1.mat1.rho .... etc at the expression box in the PDE
but anything works
Thank you
Lee
Please login with a confirmed email address before reporting spam
There are a few caveat with library materials. One is that they are often derived with internal variables such as temperature T and pressure p, and often you do not use these variables by default in your model.
Then you MUST define a Constant T=20[degC] or whatever fits you, and p=1[atm]. I believe you do not have any T defined, or did I miss the point ? (that error is at least a common one).
Next, is that when you define a material from the library, COMSOL 3.5a defines variables "mat1.something" "mat2.something" etc. and set the different (sub)domains material properties equal to the relevant "mat1.something" etc.
So either you use the domain definition through COMSOL or you access the "mat1.something" directly (but this is depending on the order you used to call them into the model.
in anycase you have a rho(T) required so T must be defined, if not through the application mode, than as a Constant
Good luck
Ivar
Please login with a confirmed email address before reporting spam
I'm using COMSOL 4.0 :)
I did again as your advice.
could you check the attached file
I just want to figure out working or not(Is setting path right expression?)
I set the value pA, T, and path "mat1.rho" in the PDE at "f"
rho has "pA*0.02897/8.314/T"
so I think rho is constant now.
but error comes out
Failed to evaluate expression.
- Expression: d((mat1.rho*test(mod1.u)-mod1.ux*test(mod1.ux)-mod1.uy*test(mod1.uy))*(dvol),{test@0})
Failed to evaluate variable.
- Variable: mat1.rho
- Geometry: 1
- Domain: 1
I think the problem is "path"
and then I put the rho equation into variable
rho1 = pA*0.02897/8.314/T, f = rho1 (in PDE)
this second one is working
I do want to know is "how to set the path for using the material property"
please give me your answer again :)
Attachments:
Please login with a confirmed email address before reporting spam
You are right about the path; one step is missing in the expression. You need to use the following syntax:
mat1.def.rho(pA,T)
where "def" points to the Basic property group, which is the source for the density rho. "def" is the tag for that node, which you can view and possibly edit by right-clicking the Basic node and choose Properties.
Best regards,
Magnus Ringh, COMSOL
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
So I type in mat2.def.alpha as part of expression for a source term and nope, cannot evaluate expression.
I also tried mat2.def.alpha()
If you look at the attached you can see it documented under "Error" ad/or you can find the source of the error in mod2->PorousHeatTransfer->JTSourceInDarcy.
Maybe the problem is that thermal coefficients are defined as anisotropic alpha11, etc in the Basic, so I've also tried alpha11, etc.
Regards, John
Attachments:
Please login with a confirmed email address before reporting spam
If you have, say, rho(T) defined in "def" defined in "mat3", then you can write mat3.def.rho(T) and all is good.
But if you have, say, rho defined in "def" defined in "mat3", then you cannot write mat3.def.rho
Tricky!!
Please login with a confirmed email address before reporting spam
Reported error is ... failed to evaluate Jacobian : Varibale mat.rho.
Please help at the earliest.
>> Shailendra
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
I need help on resolving an error :
Have enabled MATERIALS to use Nitrogen properties.
Even though have "user specified" all the thermal properties of Nitrogen and tried a combination of enable and dissable the above MATERIALS LIBRARY, the error is getting repeated.
Have also entered /added the temperature T in MATERIALS >> BASIC and USER DEFINED, as 248 deg K.
The error does not go away.
Have spent the whole day and now night on this issue.
Regards,
>> Shailendra
Attachments:
Please login with a confirmed email address before reporting spam
If I understand well all materials are
matN.def.name
where N=1,2,3 ... for the order as the material appear in the list
.def. is there for definition (not really documented so far)
and "name" stands for whatever material property name we are interested in.
Then comes the optional (pA,T), or (T) or just noting more, if the material is defined as a function of (pA,T) or of (T) or noting if a constant.
Is that so ?
to find out if there is any need for the (T) or whatever, we can check the "Materials - My_material - Basic" entry to see what the calling sequence is.
But really, this should be better documented, I cannot see where the .def. comes from or is mentioned. It is neither not appearing in the equation lists, there I only see "mat.rho" no "mat1.def.rho" even for a constant rho, so obviously you have another intermediate level (that cannot be used at postprocessing calling level)
Ivar
Please login with a confirmed email address before reporting spam
May please help on these error messages.
Thanks and Regards,
>> Shailendra (15/7)
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.