Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all 26527 articles
Browse latest View live

Tutorial: Working between COMSOL 4.1 and MATLAB 2010b

$
0
0
Ok, here is what I figured out in order to be able to take a COMSOL model, modify it in MATLAB and then reopen it in COMSOL for further work:

1. Launch COMSOL normally;
2. Launch MATLAB by using "COMSOL 4.1 with MATLAB";

In COMSOL:
- Saving your current COMSOL model into the COMSOL server:
a) File > Export Model to Server...
(Default settings: Server = localhost, Port = 2036)
Model = <filename> (Ex.: shell_diffusion)

(At that point, your COMSOL model is in the COMSOL server/buffer and is named "shell_diffusion")

In MATLAB:
- Loading your COMSOL model that you sent in the COMSOL server:
>> model = ModelUtil.model('shell_diffusion');
- Saving the file as a MATLAB .m-file:
>> model.save(<filename>, 'm'); (Ex.: model.save('shell_diffusion2', 'm'); )
(The file would be saved by default in the current working folder)
- In order to save the file in a specific folder:
>> model.save('C:\COMSOL_Models\shell_diffusion2', 'm');

(You now have created a MATLAB .m-file from a COMSOL file which you can edit and modify)
(I know, you could have just use the File > Save as Model M-File... option in COMSOL but I don't know how you could resend it to COMSOL that way)

- To save your modified model back into COMSOL:
>> model.save('C:\COMSOL_Models\shell_diffusion3'); (No specific file extension will save it as a .mph COMSOL file)

(You now have your COMSOL file back which you can reopen in COMSOL)

Defining MIXTURE of gases

$
0
0
hi friends

i want to define a mixture of gases (iodine,xe,radon) at inlet each with different concentration for diffusion in the air .
how can define mixture with different conc in comsol .

Imported SolidWorks part doesn't behave correctly

$
0
0
I'm relatively new to COMSOL but I haven't had much luck finding a solution.
I had an assembly in SolidWorks made of 3 parts. I created a new SolidWorks part file which had the 3 parts mated together correctly and saved it. I imported that SolidWorks part into COMSOL. COMSOL recognized it as having 3 domains which I assigned different material properties to. I fixed the bottom and applied a load on the top. When I ran a tetrahedral static solid model test, the stress was what I expected for the top layer but it appears that it did not make it to the remaining layers. The stress on one side of the interface is a magnitude different than the other side, right at the interface. I attached a picture of this.

The nodes seem to align at the interface too. Even when I used the same mesh size for the entire model, I had the same issue. Does anyone have suggestions on a solution? I also attached my setup.
I can provide more detail and pictures if needed.

Thanks,
Jeremy

Forced Vibration of Vertical Simply Supported Beam with 'Overhang'

$
0
0
Hi,

I'm trying to simulate the forced vibration of a beam that stands vertical and is supported by two simple supports that are shaken back and forth by a motor as in the attached schematic. I've also attached a model where the support separation is 335mm and the free length is 1599mm. I have a couple of questions I hope someone can help me with.

I've managed to perform the eigenfrequency study but the frequencies that result do not agree with ANSYS or my mathematical result (which do agree with each other). I also have a test rig running and observations of shuttle oscillation frequency agree with ANSYS and mathematical results. The results from the mathematical study and ansys put the first 3 frequencies at approximately 0.4Hz, 2.9Hz, and 8.3Hz. For some reason the first 3 eigenfrequencies from COMSOL are around 1Hz, 6.4Hz and 18Hz. Is someone able to shed some light on why this occurs? Is there a problem with my COMSOL model?

Also, in going ahead and just assuming that the frequencies are OK I've tried to do a frequency domain study to find the stresses in the beam using the eigenfrequencies obtained. I've tried adding a harmonic perturbation boundary load to the free end (just arbitrary for now at 10ms-2) but there is no deflection around the 6.4Hz eigenfrequency I found (I haven't tried other eigenfrequencies yet). Is the lack of damping the problem? My preference for FEA is COMSOL so I'd really like to find out how to do this. Haven't tried the stress study in ANSYS.

For some background to the project I've attached a video of the sculpture that this project concerns (skip to about half way to see it going). It is a Len Lye piece and the owner wants to build a larger version. Hence the FEA analysis.

Video:
www.youtube.com/watch?v=X2mFnXpNBwo

Any help would be much appreciated

Tim

Vibrating horizontal plate.

$
0
0
Good Evening everyone,

I have a really simple question, I'm sure someone knows the answer to my problem.
I'm trying to make a model of a plate, platform, anything you want to call it, that vibrates only horizontally, like a piezoelectric device. Can anyone give me some kind of explanation on how to do it?

Thank you very much.

surface to surface radiation without surface

$
0
0
Hello,

I work on a molten charge and i have some issues with radiation. Usually i use a surface to ambient radiation condition but it is not enough precise for my problem, i have to take into account the reflection of the surfaces (emissivity of other surfaces emi(ext)=0.1) arround my charge.
I have a quite simple geometry and the ambiant view factor is close to 0.
Problem is that i can't add gaz and other surfaces in my model.
Can i introduce a simple heat flux on a boundary representing the reflection of my surface?
I have done lot of tests with simpler geometry but i can't find a way to put the good condition wich is closed to what i can measure with surface-to-surface condition

For example:
Radiation to ambiant condition is assumed to be:
q1=emi(ch)*sigma_const*(T_cr^4-T^4) (W/m^2)
T_cr is the temperature of the surface of other elements which i don't wan't to draw, T is the surface temperature of the charge.

The reflection is:
q2=-(1-emi(ext))*emi*(ch)*sigma_const*(T_cr^4-T^4)*(1-Famb) (W/m^2)

I have already measure Famb, is closed to 0. But when i add this heat flux, solver doesn't converge. It seems that i can't bring power to my surface. I have also tried boundary heat source without success.
I am in 2d-axy

Any ideas?

I need some help
Thank you very much

Error: The file position must be a positive integer

$
0
0
Hello,

I am going through the SAR in human head example provided. Everything is completed as per the tutorial. I am trying to solve now.

However, I get this error:

==================================
The file position must be a positive integer.
-Position:
Error in multiphysics compilation.
-Feature: Compile Equations: Frequency Domain (sol1/st1)
-Error: The file position must be a positive integer.
==================================

What does this error mean and how do I fix it?

Thanks.

Amro

Switch the boundary condition from flux to pressure head (Richards’Equation)

$
0
0
I read some paper, in the old version of COMSOL, we can choose a Mixed boundary condition (mix of Dirichlet, Newman and Cauchy conditions). in order to automatically transfer the boundary condition form pressure head to Flux, or Flux to pressure head.

But in the new version of COMSOL 4.2 or 4.3, I can not found that kind of setting,we would like to know how to switch the boundary condition from flux to pressure head during the calculation. We started from a flux boundary for rainfall infiltration (with negative pressure head), and when the pressure head at the surface boundary becomes positive, we would like to swith it to the pressure head boundary. We have no idea how to implement it in COMSOL4.3(Richards’Equation).

Could any expert have some suggestion? I appreciate for your help.

Switch the boundary condition from flux to pressure head (Richards’Equation)

$
0
0
I read some paper, in the old version of COMSOL, we can choose a Mixed boundary condition (mix of Dirichlet, Newman and Cauchy conditions). in order to automatically transfer the boundary condition form pressure head to Flux, or Flux to pressure head.

But in the new version of COMSOL 4.2 or 4.3, I can not found that kind of setting,we would like to know how to switch the boundary condition from flux to pressure head during the calculation. We started from a flux boundary for rainfall infiltration (with negative pressure head), and when the pressure head at the surface boundary becomes positive, we would like to swith it to the pressure head boundary. We have no idea how to implement it in COMSOL4.3(Richards’Equation).

Could any expert have some suggestion? I appreciate for your help.

Magnetic Field Simulation

$
0
0
Hi,

i'm currently trying to do a mf analysis of the system in append figure.
The four quadrangular structures are coils with a external current applied. I defined all the domain's material and added the multiturn coil domain system for each coil.
But every time the result is :
Cannot Evaluate Expression

Failed to evaluate variable.
-Variable : T
Geometry : 1
Boundary : 19 -36 (last coil) or 19-90 (all coils)
-Expression :T
-Plot: surf 1

Any ideia of what i'm doing wrong?

Thank you

How to export data in excel format?

$
0
0
Hey Ivar,
I want to export my figure into excel format. and replot it in matlab. Is it possible ?
Thank you very much!!

Baofeng

Changing the predefined equations in COMSOL /adding more variable in the equation

$
0
0
Is there any feature to change the predefined equations present in any module (in my case the battery module) to edit the predefined equations to add extra variables in the predefined equation ?

If not how else u can do the same task of adding an extra variable to the predefined equations ?

In my case I want to add an extra stress variable to the concentration equation for the active particle in porous electrode.
Any one can help me out for the same ?

Best Regards,
Utsav

Apparent inconsistency in induction heating solution methods

$
0
0
Hi everyone,
I'm new to COMSOL 4.3, and I'm trying to properly use the induction heating module. While modeling the problem of a current loop heating several iron inductors embedded in water in 3D, using either External Current Density or Surface Current, I kept getting temperatures that I strongly suspected were too low. I modeled a similar problem of one inductor in axisymmetric 2D, with the intention of comparing heating via Single-Turn Coil Domain with heating from either of the aforementioned methods. I get a result that seems right to me with Single-Turn Coil Domain, but when I deactivate it and activate either External Current Density or Surface Current, I get a temperature rise of less than a degree, a similar wrong result to what I get with 3D modeling.
With External Current Density, I use the current (1000 A) divided by the cross-sectional area of the loop wire, and I use the current divided by the circumference of the loop wire when I use Surface Current instead.
I've attached the 2D axisymmetric version of the test problem that delivers incorrect results. I've slightly modified the materials such that water has a relative permittivity and permeability both of 1, and an electrical conductivity of 0.1 S/m. Can anyone let me know what I'm missing? Thanks in advance!

How to Improve Convergence in Natural Convection

$
0
0
I am wondering how I can improve convergence in my natural convection model. It is a simple model; an isothermal aluminum plate in water.

The model starts out fine but as the run continues (transient model), the plume begins to lose stability causing the problem to reduce its time stepping. I have tried re-meshing as much as my PC can handle (3 mil elements).
I am wondering what else I can do to solve this problem. Should I change tolerances, crosswind or streamline parameters. I am running out of ideas. Any help would be greatly appreciated ( as I have been stuck on this problem for several days now). I have attached the model (with no mesh or solution). Typically, the model solves the first 20-30 seconds, then the solution becomes very strange and results become unreasonable.

Problems related to relative tolerance and relative error

$
0
0
Hello

I want to reproduce a model in which there are two spheres in contact one upon the other along the z axis, and then i has applied two forces, one on the top (point or boundary region of the sphere above) with -z direction and other force on the bottom (point or boundary region of the sphere below) with z direction. In summary the idea is to confront the two spheres subject for the forces and will see the results corresponding to the stress and displacement of both spheres. Unfortunately when I solve and compute it, appear the following messages:

Failed to find a solution.
The relative residual (55) is greater than the relative tolerance.
Returned solution is not converged.

Failed to find a solution.
The relative error (2.2e2) is greater than the relative tolerance.
Returned solution is not converged.

What is the meaning of this? the reason is because the problem isn't configure correctly and therefore cannot converged? How can I avoid this problem and resolve it succesfully?

Thanks beforehand.

Marangoni Stirring / Phase Change: Weak Contribution Settings

$
0
0
Hi

I have a problem with a weak contribution in a laser surface melting model:

My model takes into account solid-liquid phase change using an enthalpy-porosity technique and liquid phase volume forces using the Boussinesque Approximation (as in the Continuous Casting tutorial). The model also takes into account Marangoni Forces on the top surface of the material via a weak contribution boundary condition with an expression:

test(u)*gamma*Tx

where u is the velocity x component, gamma is a surface tension/ temperature gradient (a constant) and Tx is the Temperature in the x direction.

The resistive volume force term in the domain beneath the top surface serves to brake the fluid motion down to that of the material (the model is Eularian, meaning the material moves rather than the laser spot) when the material is solid, and allowing additional fluid motion within the molten area.

The trouble is, when the weak contribution is added to the top surface, it seems to allow additional fluid motion in areas where the material is supposed to be solid.

How can I tie the volume force term to the Marangoni weak contribution on the surface to ensure that any additional fluid motion is only allowed within the liquid phase of the material?

Many thanks in advance for your help

Dan




Moving mesh ALE

$
0
0
Hi,

I am simulating a moving boundary with ALE method.

My program is working fine with a certain geometry, mesh and time, but if I would like to change the geometry or set a larger time, then I get a message: "last time step is not converged".

I attached the model that is not working and the good one.
Please let me know what I am doing wrong.

best regards


Define a function like Linear elastic-perfectly plastic behavior.

$
0
0
How can I define a load which increase linearly up to time t0 and then stay fix by time.
I defined something like "F*(rm1(t<t0)+step1(t))" which step function location is time t0. the only section which I do not know if it works or not is the Ramp section. I want a ramp function which goes from 0 to 1 in time domain of 0 and t0 and after t0 ramp function become zero.

Comsol RF module norm and phase

$
0
0
Dear all,

I have a problem with Comsol, a very naive one.

I am trying to do a harmonic simulation (a single frequency in frequency domain model) of the EM scattering in a domain.

For example if I have a electric dipole oscillating in a square medium. I will be able to get the norm of the electric field at any spatial point in the simulated domain by selecting the norm option in Comsol. However I am also interested in finding out the relative phase relationship between the electric field at different spatial points. If there a easy way to do it say by selecting any function in the Comsol simulation ?

All the best

Skull and Electrical Conductance

$
0
0
Hey,

I'm just a beginner with Comsol and I'm trying to build a model of a human head that includes a top layer of skull, a brain, and space in between the two filled with some kind of conductive liquid.

The idea is to model and simulate how a point voltage source somewhere within the “brain” will affect the current flow on the surface of the head through the conductive materials. The issue I’m running into is how to create a point voltage source for one (if it’s even possible) as well as the ease of the geometries I’m using.

Currently, I’m using the basic idea of a 2 cm solid sphere (the “brain”) inside another solid 2.5 cm sphere, the 2.5 cm sphere is made up of conductive water, and an additional surface sphere with a 2.5 cm radius. I’m having trouble defining the material for the surface sphere (I’ll make it something like carbon).

So my two questions are, is there any advice for creating the geometries for such an endeavor and how does one create a point voltage source inside of a model?

Thanks for any help!

Additionally, when I run the study, I'm getting the error "Failed to find a solution - Singular matrix" There are xxx void equations. Returned solution is not converged.
- What does this mean systematically? Are one of my geometries not in contact correctly?
Viewing all 26527 articles
Browse latest View live