Questions tagged [numerical-modelling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
11 views

Solving a 1D diffusion equation with linear and nonlinear source terms

I would like to numerically solve the following equation: $$\frac{\partial \rho (z,t)}{\partial t} = G - B(N_D \rho (z,t) + \rho(z,t)^2) + D \frac{\partial^2 \rho (z,t)}{\partial z^2}$$ with the ...
3
votes
1answer
52 views

Modelling flow through pipe networks

I'm trying to educate myself on modelling solute flows through pipe networks. This is a follow up of my previous post here $$\frac{\partial C}{\partial t} = - v\frac{\partial C}{\partial x}$$ While ...
2
votes
1answer
71 views

Does mass balance hold in convective diffusion

I'm trying to understand how convection-diffusion equations are solved in pipe flow modules available in CFD solvers. $$ \frac{\partial C}{\partial t} + \nabla \cdot (\mathbf{v} C) = \nabla \cdot (D \...
0
votes
1answer
81 views

Why is modeling a physical system with ODEs sufficient?

I've read a few papers in dynamical systems where the model equations are sets of ODEs, with the state space, say, the spatial variables x, y, z, and an angle variable phi all evolving forward in time....
2
votes
1answer
48 views

How to set up a time-dependant matrix for an ODE to be solved using python?

I want to solve a problem numerically in python like this: $$ y(t)' = \mathbf{M}(t)y ,\\ y(0) = (1,0,0,0 ...) $$ where $y$ is an $n$-dimensional vector and $\mathbf{M}(t)$ is a time-dependant $n \...
5
votes
2answers
110 views

Is the diffusion equation with Neumann and Dirichlet BCs well-posed?

I am considering the following diffusion equation: $$\frac{\partial f}{\partial t} = \frac{\partial}{\partial x}[D(x,t)\frac{\partial f}{\partial x}]$$ over a grid ...
1
vote
0answers
59 views

Solving diffusion equation using finite difference method

I am solving an 1-dimensional diffusion equation with Neumann boundary condition at outlet and constant concentration, C, at the inlet. In the end, I want to observe how the concentration diffuses ...
0
votes
1answer
75 views

Robin Boundary Condition with Implicit Upwind - Finite Difference Method for 2D Convection-Diffusion Equation

I am trying to solve a problem with 2D Convection-Diffusion equation with U = Concentration ($mg/m^{2}$) using Implicit Upwind Finite Difference Method like this $$ \frac{\partial U}{\partial t} + ...
0
votes
0answers
63 views

How one can simulate a system given by differential equation?

I want to simulate a diffusion environment given by the differential equation $$\frac{\partial u(x,y,t)}{\partial t}=D\left(\frac{\partial^2 u(x,y,t)}{\partial x^2}+\frac{\partial^2 u(x,y,t)}{\...
1
vote
1answer
59 views

What is the exponential trick to include laplacian term in Rayleigh-Bernard simulation

I have come across a Rayleigh-Bernard simulation code which doesn't have the laplacian term but an integrating factor (in the exponential form) containing viscosity and diffusivity. I found out that ...
6
votes
0answers
120 views

What are some good debugging habits for numerical simulation?

I'm currently writing a lid drive cavity CFD code on python. Currently, my code has some issues (values jumping bear b.c). I was wondering what are some good habits in debugging numerical codes. ...
0
votes
2answers
338 views

(FEM) 1D time-dependent heat equation convergence problem

I'm simulating a simple 3-node bar with convection BCs at the edges to validate my FEM code. The following data was used: Initial temperature = 25 ºC Temperature surrounding the rod = 10 ºC Thermal ...
15
votes
5answers
1k views

Why does the numerical solution of an ODE move away from an unstable equilibrium?

I wish to simulate the behaviour of a double-pendulum-like system. The system is a 2-degrees-of-freedom robot manipulator that is not actuated and will, therefore, behave mostly like a double-pendulum ...
7
votes
1answer
230 views

Spectral Element vs Finite Element

I am trying to understand the difference between SEM and FEM. If I go by this paper, spectral element methods are a subset of FEM methods and the only difference lies in the choice of basis functions. ...
0
votes
0answers
57 views

The final Boundary Condition is Unknown, Is Backward Euler is still valid to be implemented?

I am working on conductive polymer modeling and supposed to do one-dimensional diffusion model in the thickness of the polymer, however, due to the small value of thickness in micro, when I use the ...
2
votes
0answers
70 views

How to implement adaptive step size Runge-Kutta Cash-Karp?

Trying to implement an adaptive step size Runge-Kutta Cash-Karp but failing with this error: ...
2
votes
1answer
230 views

Analytical Solution of Transport Equation

I'm looking at the analytical solution of the convection-diffusion equation $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2}-v\frac{\partial C}{\partial x}$$ with initial ...
0
votes
1answer
48 views

Changing the domain of a 3D Finite Difference code from cube to sphere

I have an explicit FD (Finite Difference) code for diffusion/heat on a PDE in a cuboid domain, and it works fine. I would like to update the discretized equations and change the code so as to solve ...
0
votes
1answer
41 views

Given co-ordinates of 8 vertices, how to calculate the outward normal and surface area for each face of a irregular hexahedron?

I am working on an FEA mesh of hexahedron elements. The elemental level calculations involve finding the surface normals and area for each surface of a hex element. I preferred the vector cross ...
2
votes
0answers
102 views

Are there known accuracy issues between 2D axisymmetric and 3D solutions?

In my full 3D solutions I am solving for the potential throughout a $100\times 200\times 200$ grid. Inside is a ring electrode set to -5V via a Dirichlet boundary condition, and surrounded on all ...
1
vote
1answer
163 views

Libraries to deal with unstructured grids

I am dealing with a *.cgns file. This mesh format, when saved as an unstructured grid, holds nodes coordinates, nodes connectivity per element and boundary ...
3
votes
2answers
117 views

Computational cost comparison of DNS and SPH

I may be incorrect, but it seems like commercial graphics codes typically use smoothed particle hydrodynamics (SPH) to produce stunning simulations and not continuum based methods. Why is this? Is SPH ...
1
vote
1answer
80 views

Multi-steps method for Navier-stokes equations with strongly nonlinear diffusion

I am trying to solve a particular form of the Euler / Navier-Stokes equations in 1D, with very strong and non-linear diffusion coefficients. My system of equations is \begin{cases} \...
1
vote
1answer
163 views

Integrating direct dynamics form more than 1 second does not give back the correct result

I am trying to simulate a robot manipulator dynamics in SciLab. Basically, I generated a step function that has constant acceleration for half of the time and then the same acceleration but negative ...
5
votes
1answer
587 views

Solving for a set of coupled ODEs to get correct variable values

My question is about how I can solve a coupled system of ODE's, and print out the variables in a plot. I am solving for an q value and an e value, seen in this set of coupled ODE's below: $$ \begin{...
1
vote
2answers
61 views

Operator splitting for 4 subproblems

Typically an ODE System which involves 2 different physical problems such as diffusion and advection can be numerically approached by the well known Strang operator splitting scheme. I'm wondering if ...
1
vote
0answers
39 views

Limit to volume change in a discretized mathematical model?

I have set up a mathematical model describing the diffusion of ozone out of a gas bubble. The bubble is surrounded by a thin gas film. So actually, the model describes the diffusion of ozone through ...
1
vote
2answers
3k views

How does one calculate reaction force in FEA?

I wrote a UEL (User Element in Abaqus) for one element and compared to a reference UEL which used standard FEM, where the results agreed satisfactorily, except the reaction force. The stress, strain, ...
2
votes
1answer
153 views

Non-linear flux interface condition - variational formulation

Context: I am working on implementing this paper and I am struggling to come up with a variational formulation for the Butler-Volmer interface conditions. To simplify my question I consider the ...
2
votes
1answer
108 views

Calculation of the EFIE integral

I need help computing the following integral: $$ \int_{}\frac{(1+jk|\vec{r}-\vec{r}^\prime|)e^{-jk|\vec{r}-\vec{r}^\prime|}}{|\vec{r}-\vec{r}^\prime|}d\vec{r}^\prime $$ in this integral $\vec{r}$ ...
1
vote
2answers
2k views

Physics Simulation in C++

OK, I know a bit of C++ (very basic syntax), and I want to do physics simulation in C++, like stuff like (also the things mentioned here): Ripples and waves over a 2-d surface Vibrating string/...
1
vote
0answers
60 views

Rotational kinematics problem @ $\theta = 0$

I'm simulating a magnetic dipole that is subjected to an evolving magnetic field. In ISO convention ($\theta$ is the polar angle and $\phi$ is the azimuthal angle), my equation of motion that is ...
0
votes
1answer
106 views

Non-linearities in modal analysis of flexible beam

I'm trying to analyse the behaviour of a wind turbine blade rigidly connected to a wall during fatigue testing, being excited in it's first mode in two orthogaonal directions simultaneously (the first ...
4
votes
1answer
96 views

Finite-volume method applied to a particular advection equation

I'm trying to apply the finite-volume method (FVM), with which I'm not so familiar, so a simple 1D PDE equation. I already asked this question in the math stackexchange, but was told that it could be ...
0
votes
1answer
191 views

PDEPE nonlinear

I would like to use Matlab's pdepe to solve this system: $$ s_t =(sr)_x + s_{ xx } \\ r_t =(\frac{ A }{ B }r^2+s)_x + \frac{ A }{ -K } r_{ xx } $$ where $A$, $B$ ...
1
vote
0answers
22 views

Uniform distribution in 3D space [duplicate]

Posted this at math stack exchange as well, but alas no replies! So, I have been trying to find ways of distributing particles of spherical or other shape in 3D space, e.g. rectangular space. Random() ...
1
vote
1answer
172 views

Bulirsch-Stoer algorithm to solve simple chemistry. Spanning long time intervals after stationarity

Hi all and thank you in advance. I am working on a time-dependent transport-chemistry model to study the composition of planetary atmospheres. The equations are the following $$\frac{\partial n(z,t)}...
0
votes
1answer
399 views

Is the exponential function, e^x, very expensive to compute in Matlab and harmful to my computer?

Is the exponential function problematic and very expensive to compute in Matlab? When I write a new term for my model of ODEs that has an exponential term in it, the program almost never finishes ...
2
votes
0answers
38 views

One dimensional differential equation with resonance recombination (RHS) [closed]

I am trying to solve the following equation: $$\dfrac{\partial }{\partial \epsilon}\left[B\left(\epsilon\right)f_e\left(1-f_e\right)+D\left(\epsilon\right)\dfrac{\partial f_e}{\partial \epsilon}\...
6
votes
4answers
202 views

In Matlab, how can I be consistent with units?

I am modeling some aerodynamics equations and am using meters / centimeters, kilograms, and seconds. I've heard that, "matlab doesn't know units". So, how can I make sure that it does? Just ...
1
vote
2answers
127 views

Rule of thumb for time-step for solving Maxwell's Equation using 3D-FDTD?

Is there something like a rule of thumb for an adequate time-step size when solving Maxwell's equation for the interaction of light with matter? I guess a single wave oscillation has to be resolved ...
3
votes
1answer
382 views

Scaling/nondimensionalization for numerical optimization

I have a numerical optimization problem that I am trying to scale appropriately, in order to allow for the solver to achieve faster and more accurate results. I found a paper here that had a short ...
0
votes
3answers
144 views

How to determine a PDE which is structure-preserving (energy, mass conserved)?

How to determine if a PDE is structure-preserving (energy,mass conserved)? Are there some standards in judging the preserving-structure? Or rather, how to derive the formulation of energy-preserved ...
1
vote
0answers
47 views

Fit constant term in LM algorithm

I'm using the Levenberg-Marquardt algorithm to fit my data with a Gaussian function: $$ f(x)=a\cdot e^{-\frac{(x-c)^2}{2\sigma^2}}+f_0 $$ $a$, $c$, $\sigma$ and $f_0$ are the fitting parameters. The ...
3
votes
1answer
147 views

Reasons to choose LES in stead of RANS models? (turbulence)

In oceanography, is there any particular reason why choosing large eddy simulations in stead of RANS (regardless of the type of flow)? In both cases, 2d simulations would be used (shallow water model)....
1
vote
0answers
112 views

Strange solutions using Finite Element Analysis

I've implemented the Finite Element Method to model the heat transfer between two different materials where one material is surrounded by the other. When I run the model I'm getting some strange ...
0
votes
2answers
125 views

If a numerical solution remains constant for different grid sizes, what does it mean?

I'm testing a finite volume scheme, Godunov type solver, using a problem with analytical solution. I'm not able to reproduce the solution, which includes source terms. I tried with different mesh ...
0
votes
1answer
717 views

How to construct an ellipsoid using Ansys design modeller (or any other 3D CAD software) [closed]

I am working on numerical simulation of breast model to evaluate the use of thermal imaging for breast cancer detection. To do this I need to construct an ellipsoid rotated 30 degrees around y-axis ...
7
votes
1answer
423 views

Discrete wave simulation - absorbing boundaries?

I wrote a simple 2D wave simulation using the following equations: $$\frac{\partial^2 u}{\partial t^2}=c^2\nabla^2u$$ Where $\nabla^2$ is the discrete laplace operator using a Von Neumann neighborhood ...
1
vote
1answer
92 views

If I discretize a PDE in space with WENO and in time with an implicit method, do I need to solve a nonlinear algebraic system at each time step?

I am attempting to solve a nonlinear advection diffusion equation $$\frac{\partial u}{\partial t} = \frac{\partial}{\partial x}(\frac{\partial u}{\partial x} + u^2)$$ with Robin boundary conditions ...