FDEM数值模拟方法介绍
时间: 2023-02-08 14:30:35 浏览: 1137
FDEM(有限差分电磁学)是一种数值模拟电磁学的方法。它使用有限差分算法来求解电磁场方程,可以模拟多种电磁场问题,如电磁波传播、电磁辐射和电磁效应等。FDEM具有较高的精度和较快的计算速度,并且可以模拟复杂的场景和物理现象。
相关问题
y-geo fdem
y-geo fdem是一种基于有限元法(Finite Element Method,简称FEM)的地质数值模拟方法。FEM是数值计算中常用的一种方法,它将一个大范围的物理模型划分成许多小的有限单元,以逼近模型的真实行为。y-geo fdem则是利用FEM来模拟地质现象和过程的一种特定的实施方法。
y-geo fdem方法可以应用于多个地质领域,例如地下水流、地热系统、岩土工程等。它通过将地质模型划分成小的单元,并在每个单元内定义适当的数学模型和边界条件,来解决地质过程中的问题。这些问题可能涉及流体流动、热传导、质量传输等。通过对每个单元的数学模型进行离散化和求解,可以得到整个地质系统的行为和性能的预测和分析。
y-geo fdem方法具有较高的精度和灵活性。由于有限元法的离散化特性,它可以更好地逼近真实的地质场景,并考虑到地质材料的非线性特性、边界效应等。此外,该方法还可以考虑时间和空间上的变化,以模拟和预测地质现象的动态变化。
总之,y-geo fdem是一种基于有限元法的地质数值模拟方法,通过离散化地质模型,求解数学模型并考虑物理边界条件,可以对地质现象和过程进行精确的模拟和分析。
解释:target = self.survey.source.target collection = self.survey.source.collection '''Mesh''' # Conductivity in S/m (or resistivity in Ohm m) background_conductivity = 1e-6 air_conductivity = 1e-8 # Permeability in H/m background_permeability = mu_0 air_permeability = mu_0 dh = 0.1 # base cell width dom_width = 20.0 # domain width # num. base cells nbc = 2 ** int(np.round(np.log(dom_width / dh) / np.log(2.0))) # Define the base mesh h = [(dh, nbc)] mesh = TreeMesh([h, h, h], x0="CCC") # Mesh refinement near transmitters and receivers mesh = refine_tree_xyz( mesh, collection.receiver_location, octree_levels=[2, 4], method="radial", finalize=False ) # Refine core mesh region xp, yp, zp = np.meshgrid([-1.5, 1.5], [-1.5, 1.5], [-6, -4]) xyz = np.c_[mkvc(xp), mkvc(yp), mkvc(zp)] mesh = refine_tree_xyz(mesh, xyz, octree_levels=[0, 6], method="box", finalize=False) mesh.finalize() '''Maps''' # Find cells that are active in the forward modeling (cells below surface) ind_active = mesh.gridCC[:, 2] < 0 # Define mapping from model to active cells active_sigma_map = maps.InjectActiveCells(mesh, ind_active, air_conductivity) active_mu_map = maps.InjectActiveCells(mesh, ind_active, air_permeability) # Define model. Models in SimPEG are vector arrays N = int(ind_active.sum()) model = np.kron(np.ones((N, 1)), np.c_[background_conductivity, background_permeability]) ind_cylinder = self.getIndicesCylinder( [target.position[0], target.position[1], target.position[2]], target.radius, target.length, [target.pitch, target.roll], mesh.gridCC ) ind_cylinder = ind_cylinder[ind_active] model[ind_cylinder, :] = np.c_[target.conductivity, target.permeability] # Create model vector and wires model = mkvc(model) wire_map = maps.Wires(("sigma", N), ("mu", N)) # Use combo maps to map from model to mesh sigma_map = active_sigma_map * wire_map.sigma mu_map = active_mu_map * wire_map.mu '''Simulation''' simulation = fdem.simulation.Simulation3DMagneticFluxDensity( mesh, survey=self.survey.survey, sigmaMap=sigma_map, muMap=mu_map, Solver=Solver ) '''Predict''' # Compute predicted data for your model. dpred = simulation.dpred(model) dpred = dpred * 1e9 # Data are organized by frequency, transmitter location, then by receiver. # We had nFreq transmitters and each transmitter had 2 receivers (real and # imaginary component). So first we will pick out the real and imaginary # data bx_real = dpred[0: len(dpred): 6] bx_imag = dpred[1: len(dpred): 6] bx_total = np.sqrt(np.square(bx_real) + np.square(bx_imag)) by_real = dpred[2: len(dpred): 6] by_imag = dpred[3: len(dpred): 6] by_total = np.sqrt(np.square(by_real) + np.square(by_imag)) bz_real = dpred[4: len(dpred): 6] bz_imag = dpred[5: len(dpred): 6] bz_total = np.sqrt(np.square(bz_real) + np.square(bz_imag)) mag_data = np.c_[mkvc(bx_total), mkvc(by_total), mkvc(bz_total)] if collection.SNR is not None: mag_data = self.mag_data_add_noise(mag_data, collection.SNR) data = np.c_[collection.receiver_location, mag_data] # data = (data, ) return data
这段代码是一个 Python 函数,它的作用是进行三维电磁正演模拟,并返回模拟得到的数据。函数中的参数包括一个 Survey 对象和一个 Target 对象,表示要模拟的测量参数和模拟目标。函数主要分为三个部分:
1.建立网格和定义模型属性,包括电导率、磁导率和网格大小等。
2.根据接收器位置和目标位置对网格进行细化,以提高模拟精度。
3.进行电磁正演模拟,并返回模拟得到的数据。
其中,模拟的过程中还进行了噪声的添加,以模拟实际测量中的误差。
阅读全文